@@ -50,23 +50,27 @@ teardown() {
50
50
@test " create: With a custom name (using option --container)" {
51
51
pull_default_image
52
52
53
- run --separate-stderr " $TOOLBX " create --container " custom-containerName"
53
+ local container=" custom-containerName"
54
+
55
+ run --separate-stderr " $TOOLBX " create --container " $container "
54
56
55
57
assert_success
56
- assert_line --index 0 " Created container: custom-containerName "
57
- assert_line --index 1 " Enter with: toolbox enter custom-containerName "
58
+ assert_line --index 0 " Created container: $container "
59
+ assert_line --index 1 " Enter with: toolbox enter $container "
58
60
assert [ ${# lines[@]} -eq 2 ]
59
61
assert [ ${# stderr_lines[@]} -eq 0 ]
60
62
}
61
63
62
64
@test " create: With a custom image and name (using option --container)" {
63
65
pull_distro_image fedora 34
64
66
65
- run --separate-stderr " $TOOLBX " create --container " fedora34" --image fedora-toolbox:34
67
+ local container=" fedora34"
68
+
69
+ run --separate-stderr " $TOOLBX " create --container " $container " --image fedora-toolbox:34
66
70
67
71
assert_success
68
- assert_line --index 0 " Created container: fedora34 "
69
- assert_line --index 1 " Enter with: toolbox enter fedora34 "
72
+ assert_line --index 0 " Created container: $container "
73
+ assert_line --index 1 " Enter with: toolbox enter $container "
70
74
assert [ ${# lines[@]} -eq 2 ]
71
75
assert [ ${# stderr_lines[@]} -eq 0 ]
72
76
}
@@ -143,15 +147,17 @@ teardown() {
143
147
144
148
pull_distro_image arch latest
145
149
150
+ local container=" arch-toolbox-latest"
151
+
146
152
run --separate-stderr " $TOOLBX " create --distro arch
147
153
148
154
assert_success
149
- assert_line --index 0 " Created container: arch-toolbox-latest "
155
+ assert_line --index 0 " Created container: $container "
150
156
151
157
if [ " $system_id " = " arch" ]; then
152
158
assert_line --index 1 " Enter with: toolbox enter"
153
159
else
154
- assert_line --index 1 " Enter with: toolbox enter arch-toolbox-latest "
160
+ assert_line --index 1 " Enter with: toolbox enter $container "
155
161
fi
156
162
157
163
assert [ ${# lines[@]} -eq 2 ]
@@ -160,7 +166,7 @@ teardown() {
160
166
run podman ps --all
161
167
162
168
assert_success
163
- assert_output --regexp " Created[[:blank:]]+arch-toolbox-latest "
169
+ assert_output --regexp " Created[[:blank:]]+$container "
164
170
}
165
171
166
172
@test " create: Arch Linux ('--release latest')" {
0 commit comments