Skip to content

Commit 9801a59

Browse files
committed
Added tests for cfbs add absolute path
Signed-off-by: Victor Moene <victor.moene@northern.tech>
1 parent 906fa25 commit 9801a59

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
cleanup() {
10+
rm -rf /tmp/foo
11+
}
12+
trap cleanup EXIT QUIT TERM
13+
mkdir -p /tmp/foo
14+
15+
# Add first commit
16+
cp -r ../sample/foo/main.cf /tmp/foo/foo.cf
17+
git init /tmp/foo
18+
cd /tmp/foo
19+
git add /tmp/foo/foo.cf
20+
git commit -m "initial commit"
21+
head_commit=$(git rev-parse HEAD)
22+
cd -
23+
24+
# run cfbs
25+
cfbs --non-interactive init --masterfiles no
26+
cfbs --non-interactive add /tmp/foo
27+
cfbs build
28+
29+
grep "$head_commit" cfbs.json
30+
31+
# Add second commit
32+
cp ../sample/bar/baz/main.cf /tmp/foo/baz.cf
33+
cd /tmp/foo
34+
git add /tmp/foo/baz.cf
35+
git commit -m "second commit"
36+
head_commit=$(git rev-parse HEAD)
37+
cd -
38+
39+
# run cfbs
40+
cfbs --non-interactive update
41+
cfbs build
42+
43+
grep "$head_commit" cfbs.json

tests/shell/all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ bash tests/shell/043_replace_version.sh
5050
bash tests/shell/044_replace.sh
5151
bash tests/shell/045_update_from_url_branch_uptodate.sh
5252
bash tests/shell/046_update_from_url_branch.sh
53+
bash tests/shell/047_absolute_path_modules.sh
5354

5455
echo "All cfbs shell tests completed successfully!"

0 commit comments

Comments
 (0)