Skip to content

Commit

Permalink
basic docker-based test to run locally and eventually in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
craigcomstock committed Aug 28, 2023
1 parent 0849f7d commit ba21ca9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cfbs.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"tags": ["local"],
"added_by": "cfbs add",
"steps": [
"directory ./ services/cfbs/tests/",
"policy_files services/cfbs/tests/",
"bundles __main__"
"directory ./ services/cfbs/tests/"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions ci/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cfbs build
docker run -v ./out/masterfiles:/var/lib/cfengine/inputs -it agent cf-promises
docker run -v ./out/masterfiles:/var/lib/cfengine/inputs -it agent cf-agent -KIf services/cfbs/tests/www-test.cf
5 changes: 3 additions & 2 deletions tests/www-test.cf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ body file control
{
inputs => {
"${sys.libdir}/testing.cf",
"$(sys.policy_entry_dirname)/../../policy/www.cf"
"$(sys.policy_entry_dirname)/../policy/www.cf"
};
}

Expand All @@ -16,7 +16,8 @@ bundle agent test
bundle agent check
{
classes:
"dir_exists" expression => isdir("/src/www");
"dir_exists" expression => isdir("/src/www/."),
scope => "namespace"; # make global for use by testing.cf

methods:
"Register test case"
Expand Down

0 comments on commit ba21ca9

Please sign in to comment.