mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Test fixture and functional test for compliance fetcher
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
f4a3cf9144
commit
913c066be9
11 changed files with 54 additions and 0 deletions
BIN
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing-0.1.0.tar.gz
vendored
Normal file
BIN
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing-0.1.0.tar.gz
vendored
Normal file
Binary file not shown.
5
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing/controls/auto-dep-on-missing.rb
vendored
Normal file
5
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing/controls/auto-dep-on-missing.rb
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
control "auto-dep-on-missing-01" do
|
||||
describe "a string" do
|
||||
it { should cmp "a string" }
|
||||
end
|
||||
end
|
1
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing/controls/include-missing.rb
vendored
Normal file
1
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing/controls/include-missing.rb
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
include_controls("auto-missing")
|
9
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing/inspec.yml
vendored
Normal file
9
test/fixtures/profiles/fetcher-failures/auto-dep-on-missing/inspec.yml
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
name: auto-dep-on-missing
|
||||
title: A profile that depends on a profile that has gone missing
|
||||
summary: An InSpec Compliance Profile
|
||||
version: 0.1.0
|
||||
supports:
|
||||
platform: os
|
||||
depends:
|
||||
- name: auto-missing
|
||||
compliance: admin/auto-missing
|
1
test/fixtures/profiles/fetcher-failures/auto-missing/controls/include-basic.rb
vendored
Normal file
1
test/fixtures/profiles/fetcher-failures/auto-missing/controls/include-basic.rb
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
include_controls("basic")
|
5
test/fixtures/profiles/fetcher-failures/auto-missing/controls/missing.rb
vendored
Normal file
5
test/fixtures/profiles/fetcher-failures/auto-missing/controls/missing.rb
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
control "missing-01" do
|
||||
describe "a string" do
|
||||
it { should cmp "a string" }
|
||||
end
|
||||
end
|
9
test/fixtures/profiles/fetcher-failures/auto-missing/inspec.yml
vendored
Normal file
9
test/fixtures/profiles/fetcher-failures/auto-missing/inspec.yml
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
name: auto-missing
|
||||
title: A profile that will be deleted from Automate
|
||||
license: Apache-2.0
|
||||
version: 0.1.0
|
||||
supports:
|
||||
platform: os
|
||||
depends:
|
||||
- name: basic
|
||||
compliance: admin/basic
|
|
@ -0,0 +1 @@
|
|||
include_controls("auto-dep-on-missing")
|
|
@ -0,0 +1,5 @@
|
|||
control "local-dep-on-bad-archive-01" do
|
||||
describe "a string" do
|
||||
it { should cmp "a string" }
|
||||
end
|
||||
end
|
8
test/fixtures/profiles/fetcher-failures/local-dep-on-bad-auto-archive/inspec.yml
vendored
Normal file
8
test/fixtures/profiles/fetcher-failures/local-dep-on-bad-auto-archive/inspec.yml
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
name: local-dep-on-bad-auto-archive
|
||||
title: An inspec profile that has a local dep on an archive that has unresolvable deps
|
||||
version: 0.1.0
|
||||
supports:
|
||||
platform: os
|
||||
depends:
|
||||
- name: auto-dep-on-missing
|
||||
path: ../auto-dep-on-missing-0.1.0.tar.gz
|
|
@ -91,5 +91,15 @@ describe "the fetchers" do
|
|||
assert_archive_worked(run_result)
|
||||
end
|
||||
end
|
||||
|
||||
# To develop on this test, setup an Automate server, run
|
||||
# `inspec compliance login`, and upload two profiles to the admin account:
|
||||
# test/fixtures/profiles/fetcher-failures/{basic,auto-dep-on-missing}
|
||||
describe "when using a compliance fetcher" do
|
||||
let(:profile_name) { "local-dep-on-bad-auto-archive" }
|
||||
it "should be able to create a new archive wrapping the profile" do
|
||||
assert_archive_worked(run_result)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue