-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy patht1001-generate-template.t
More file actions
executable file
·51 lines (46 loc) · 1.04 KB
/
t1001-generate-template.t
File metadata and controls
executable file
·51 lines (46 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
test_description='Test generate template'
. ./sharness.sh
test_expect_success CAT,ECHO,HEAD,JQ 'Test oci-runtime-tool generate --template with an empty template' "
echo '{}' >template &&
oci-runtime-tool generate --template template | jq . >actual &&
cat <<-EOF >expected &&
{
\"ociVersion\": \"1.0.0\",
\"process\": {
\"user\": {
\"uid\": 0,
\"gid\": 0
},
\"args\": null,
\"cwd\": \"/\"
},
\"root\": {
\"path\": \"rootfs\"
}
}
EOF
test_cmp expected actual
"
test_expect_success CAT,HEAD,JQ 'Test oci-runtime-tool generate --template with a different version' "
echo '{\"ociVersion\": \"1.0.0-rc9\"}' >template &&
oci-runtime-tool generate --template template | jq . >actual &&
cat <<-EOF >expected &&
{
\"ociVersion\": \"1.0.0-rc9\",
\"process\": {
\"user\": {
\"uid\": 0,
\"gid\": 0
},
\"args\": null,
\"cwd\": \"/\"
},
\"root\": {
\"path\": \"rootfs\"
}
}
EOF
test_cmp expected actual
"
test_done