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 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#!/usr/bin/env bats
load helpers
@test "mount-flags-order-verification" {
run_buildah 125 mount cnt1 --notruncate path1
check_options_flag_err "--notruncate"
run_buildah 125 mount cnt1 --notruncate
check_options_flag_err "--notruncate"
run_buildah 125 mount cnt1 path1 --notruncate
check_options_flag_err "--notruncate"
}
@test "mount one container" {
_prefetch alpine
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
cid=$output
run_buildah mount "$cid"
}
@test "mount bad container" {
run_buildah 125 mount badcontainer
}
@test "mount multi images" {
_prefetch alpine
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
cid1=$output
run_buildah from --quiet --pull-never $WITH_POLICY_JSON alpine
cid2=$output
run_buildah from --quiet --pull-never $WITH_POLICY_JSON alpine
cid3=$output
run_buildah mount "$cid1" "$cid2" "$cid3"
}
@test "mount multi images one bad" {
_prefetch alpine
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
cid1=$output
run_buildah from --quiet --pull-never $WITH_POLICY_JSON alpine
cid2=$output
run_buildah from --quiet --pull-never $WITH_POLICY_JSON alpine
cid3=$output
run_buildah 125 mount "$cid1" badcontainer "$cid2" "$cid3"
}
@test "list currently mounted containers" {
_prefetch alpine
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
cid1=$output
run_buildah mount "$cid1"
run_buildah from --quiet --pull-never $WITH_POLICY_JSON alpine
cid2=$output
run_buildah mount "$cid2"
run_buildah from --quiet --pull-never $WITH_POLICY_JSON alpine
cid3=$output
run_buildah mount "$cid3"
run_buildah mount
expect_line_count 3
expect_output --from="${lines[0]}" --substring "/tmp" "mount line 1 of 3"
expect_output --from="${lines[1]}" --substring "/tmp" "mount line 2 of 3"
expect_output --from="${lines[2]}" --substring "/tmp" "mount line 3 of 3"
}
|