Skip to content

Commit

Permalink
tests: Remove erroneous --rm run options
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Faria <[email protected]>
  • Loading branch information
albertofaria committed Apr 24, 2024
1 parent 8fd40d1 commit 164322f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
6 changes: 5 additions & 1 deletion tests/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,11 @@ run)
xargs --no-run-if-empty ${engine_cmd[*]} stop --time 0 \
>/dev/null 2>&1
${engine_cmd[*]} ps --filter label=$label --format '{{.Names}}' --all |
xargs --no-run-if-empty ${engine_cmd[*]} rm --force
xargs --no-run-if-empty ${engine_cmd[*]} rm --force \
>/dev/null 2>&1 \
|| true # avoid 'removal already in progress' docker errors
${engine_cmd[*]} ps --filter label=$label --format '{{.Names}}' --all |
xargs --no-run-if-empty false # fail if containers still exist
sudo rm -fr $label.temp $label.util
"

Expand Down
6 changes: 1 addition & 5 deletions tests/t/cloud-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ EOF
cat >"$TEMP_DIR/meta-data" <<EOF
EOF

__engine run \
--rm --detach \
--name cloud-init \
"$image" \
--cloud-init "$TEMP_DIR"
__engine run --detach --name cloud-init "$image" --cloud-init "$TEMP_DIR"

__test() {
__engine exec cloud-init --as "$user" "cmp $home/file <<< hello"
Expand Down
12 changes: 4 additions & 8 deletions tests/t/hostname.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ for os in fedora coreos; do

# default hostname

id=$(
__engine run \
--rm --detach \
--name "hostname-$os-default" \
"$image" \
""
)
id=$( __engine run --detach --name "hostname-$os-default" "$image" "" )

__test() {
__engine exec "hostname-$os-default" --as "$user" \
Expand All @@ -25,11 +19,12 @@ for os in fedora coreos; do
__test

__engine stop --time 0 "hostname-$os-default"
__engine rm "hostname-$os-default"

# custom hostname

__engine run \
--rm --detach \
--detach \
--name "hostname-$os-custom" \
--hostname my-test-vm \
"$image" \
Expand All @@ -45,5 +40,6 @@ for os in fedora coreos; do
__test

__engine stop --time 0 "hostname-$os-custom"
__engine rm "hostname-$os-custom"

done
6 changes: 1 addition & 5 deletions tests/t/ignition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ cat >"$TEMP_DIR/config.ign" <<EOF
}
EOF

__engine run \
--rm --detach \
--name ignition \
"$image" \
--ignition "$TEMP_DIR/config.ign"
__engine run --detach --name ignition "$image" --ignition "$TEMP_DIR/config.ign"

__test() {
__engine exec ignition --as "$user" "cmp $home/file <<< hello"
Expand Down
3 changes: 2 additions & 1 deletion tests/t/mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for os in fedora coreos; do
echo hello > "$TEMP_DIR/file"

__engine run \
--rm --detach \
--detach \
--name "mount-$os" \
--volume "$TEMP_DIR/file:$home/file:z" \
--volume "$TEMP_DIR:$home/dir:z" \
Expand Down Expand Up @@ -43,5 +43,6 @@ for os in fedora coreos; do
__test

__engine stop --time 0 "mount-$os"
__engine rm "mount-$os"

done

0 comments on commit 164322f

Please sign in to comment.