Skip audit log test on Windows (#6950)

* Skip audit log test on Windows

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Fix the text in the audit log test

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
This commit is contained in:
Vasundhara Jagdale 2024-01-24 08:30:51 +00:00 committed by GitHub
parent 329eafa8f9
commit dc7631b8ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,8 @@ describe "inspec audit log feature" do
end end
describe "When audit logging off" do describe "When audit logging off" do
it "should not create create audit log file in the default location when inpsec exec run" do it "should not create create audit log file in the default location when inspec exec is run" do
skip_windows!
cli_args = "--audit-log-location #{Inspec.log_dir}/inspec-test-audit.log" cli_args = "--audit-log-location #{Inspec.log_dir}/inspec-test-audit.log"
run_result = run_inspec_process("exec " + File.join(profile_path, "basic_profile") + " " + cli_args) run_result = run_inspec_process("exec " + File.join(profile_path, "basic_profile") + " " + cli_args)
_(run_result.exit_status).must_equal 0 _(run_result.exit_status).must_equal 0
@ -23,7 +24,8 @@ describe "inspec audit log feature" do
end end
describe "When audit logging on" do describe "When audit logging on" do
it "should create audit log file in the default location when inpsec exec run" do it "should create audit log file in the default location when inspec exec is run" do
skip_windows!
cli_args = "--audit-log-location #{Inspec.log_dir}/inspec-test-audit.log" cli_args = "--audit-log-location #{Inspec.log_dir}/inspec-test-audit.log"
run_result = run_inspec_process("exec " + File.join(profile_path, "basic_profile") + " " + cli_args, env: { CHEF_PREVIEW_AUDIT_LOGGING: "1" }) run_result = run_inspec_process("exec " + File.join(profile_path, "basic_profile") + " " + cli_args, env: { CHEF_PREVIEW_AUDIT_LOGGING: "1" })
_(run_result.exit_status).must_equal 0 _(run_result.exit_status).must_equal 0
@ -31,7 +33,8 @@ describe "inspec audit log feature" do
_(File.basename(Dir.glob("#{Inspec.log_dir}/*")[0])).must_match(/inspec-test-audit-\d{4}\d{2}\d{2}T\d{2}\d{2}\d{2}-\b\d+\b.log/) _(File.basename(Dir.glob("#{Inspec.log_dir}/*")[0])).must_match(/inspec-test-audit-\d{4}\d{2}\d{2}T\d{2}\d{2}\d{2}-\b\d+\b.log/)
end end
it "should create inspec-audit.log file in the default location when inpsec exec run" do it "should create audit log file in the default location when inspec shell is run" do
skip_windows!
cli_args = " --audit-log-location #{Inspec.log_dir}/inspec-test-audit.log" cli_args = " --audit-log-location #{Inspec.log_dir}/inspec-test-audit.log"
run_result = run_inspec_process("shell " + " " + cli_args, env: { CHEF_PREVIEW_AUDIT_LOGGING: "1" }) run_result = run_inspec_process("shell " + " " + cli_args, env: { CHEF_PREVIEW_AUDIT_LOGGING: "1" })
_(run_result.exit_status).must_equal 0 _(run_result.exit_status).must_equal 0