Skip to content

Commit 49e7aff

Browse files
committed
Added tests for cfbs update for modules added by url.
Signed-off-by: Victor Moene <victor.moene@northern.tech>
1 parent 8736e7b commit 49e7aff

5 files changed

Lines changed: 84 additions & 0 deletions

File tree

tests/shell/039_update_from_url.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
rm -rf delete-files
9+
10+
cp ../shell/039_update_from_url/example-cfbs.json cfbs.json
11+
cp -r ../shell/039_update_from_url/delete-files .
12+
13+
cfbs --loglevel=debug --non-interactive update
14+
grep 'Specify another file you want deleted on your hosts?' delete-files/input.json
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"type": "list",
4+
"variable": "files",
5+
"namespace": "delete_files",
6+
"bundle": "delete_files",
7+
"label": "Files",
8+
"subtype": [
9+
{
10+
"key": "path",
11+
"type": "string",
12+
"label": "Path",
13+
"question": "Path to file"
14+
},
15+
{
16+
"key": "why",
17+
"type": "string",
18+
"label": "Why",
19+
"question": "Why should this file be deleted?",
20+
"default": "Unknown"
21+
}
22+
],
23+
"while": "test?"
24+
}
25+
]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "Example project",
3+
"description": "Example description",
4+
"type": "policy-set",
5+
"git": true,
6+
"build": [
7+
{
8+
"name": "delete-files",
9+
"description": "Allows you to specify a list of files you want deleted on hosts in your infrastructure. When this module is deployed as part of your policy set, every time CFEngine runs, it will check if those files exist, and delete them if they do.",
10+
"url": "https://github.com/nickanderson/cfengine-delete-files.git",
11+
"commit": "0000000000000000000000000000000000000000",
12+
"added_by": "cfbs add",
13+
"steps": [
14+
"copy delete-files.cf services/cfbs/modules/delete-files/delete-files.cf",
15+
"input delete-files/input.json def.json",
16+
"something test"
17+
],
18+
"input": [
19+
{
20+
"type": "list",
21+
"variable": "files",
22+
"namespace": "delete_files",
23+
"bundle": "delete_files",
24+
"label": "Files",
25+
"subtype": [
26+
{
27+
"key": "path",
28+
"type": "string",
29+
"label": "Path",
30+
"question": "Path to file"
31+
},
32+
{
33+
"key": "why",
34+
"type": "string",
35+
"label": "Why",
36+
"question": "Why should this file be deleted?",
37+
"default": "Unknown"
38+
}
39+
],
40+
"while": "test?"
41+
}
42+
]
43+
}
44+
]
45+
}

tests/shell/040_update_from_url_steps.sh

Whitespace-only changes.

tests/shell/041_update_from_url_inputs.sh

Whitespace-only changes.

0 commit comments

Comments
 (0)