File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed
046_update_from_url_branch Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ set -e
2+ set -x
3+ cd tests/
4+ mkdir -p ./tmp/
5+ cd ./tmp/
6+ touch cfbs.json && rm cfbs.json
7+ rm -rf .git
8+
9+ cfbs --non-interactive init --masterfiles no
10+ cfbs --non-interactive add https://github.com/cfengine/test-cfbs-static-repo/@update-test-branch test-library-parsed-local-users
11+
12+ # check that cfbs.json contains the right commit hash (ideally for testing, different than the default branch's commit hash):
13+ grep ' "commit": "2152eb5a39fbf9b051105b400639b436bd53ab87"' cfbs.json
14+ # check that branch key is correctly set:
15+ grep ' "branch": "update-test-branch"' cfbs.json
16+
17+ cfbs update test-library-parsed-local-users | grep " Module 'test-library-parsed-local-users' already up to date"
Original file line number Diff line number Diff line change 1+ set -e
2+ set -x
3+ cd tests/
4+ mkdir -p ./tmp/
5+ cd ./tmp/
6+ touch cfbs.json && rm cfbs.json
7+ rm -rf .git
8+
9+ cfbs --non-interactive init --masterfiles no
10+ cfbs --non-interactive add https://github.com/cfengine/test-cfbs-static-repo/@update-test-branch test-library-parsed-local-users
11+
12+ cp ../shell/046_update_from_url_branch/cfbs.json .
13+
14+ cfbs update test-library-parsed-local-users | grep " Updated module 'test-library-parsed-local-users' from url"
15+ # check that the commit hash changed:
16+ grep ' "commit": "2152eb5a39fbf9b051105b400639b436bd53ab87"' cfbs.json
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " Example project" ,
3+ "description" : " Example description" ,
4+ "type" : " policy-set" ,
5+ "git" : true ,
6+ "build" : [
7+ {
8+ "name" : " test-library-parsed-local-users" ,
9+ "description" : " Parse local users from /etc/passwd on the system with their attributes from /etc/shadow" ,
10+ "url" : " https://github.com/cfengine/test-cfbs-static-repo/" ,
11+ "commit" : " f702461f319e170db05bcb61f867b440b5cbd013" ,
12+ "branch" : " update-test-branch" ,
13+ "subdirectory" : " test_library_parsed_etc_passwd_shadow" ,
14+ "added_by" : " cfbs add" ,
15+ "steps" : [
16+ " copy ./test_library_parsed_etc_passwd_shadow.cf services/local-users/test_library_parsed_etc_passwd_shadow/" ,
17+ " json cfbs/def.json def.json"
18+ ]
19+ }
20+ ]
21+ }
Original file line number Diff line number Diff line change @@ -48,5 +48,7 @@ bash tests/shell/041_add_multidep.sh
4848bash tests/shell/042_update_from_url.sh
4949bash tests/shell/043_replace_version.sh
5050bash tests/shell/044_replace.sh
51+ bash tests/shell/045_update_from_url_branch_uptodate.sh
52+ bash tests/shell/046_update_from_url_branch.sh
5153
5254echo " All cfbs shell tests completed successfully!"
You can’t perform that action at this time.
0 commit comments