System tests: make sure exec pid hash w/o leaking
podman exec leaks an exec_pid_<hash> file for every exec in tmpfs, it's known rhbz#1731117, this case makes sure leakage issue has been fixed. rhbz: https://bugzilla.redhat.com/show_bug.cgi?id=1731117 Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
This commit is contained in:
parent
b6fdfa041a
commit
774a36d177
|
|
@ -29,4 +29,24 @@ load helpers
|
|||
run_podman rm $cid
|
||||
}
|
||||
|
||||
@test "podman exec - leak check" {
|
||||
skip_if_remote
|
||||
|
||||
# Start a container in the background then run exec command
|
||||
# three times and make sure no any exec pid hash file leak
|
||||
run_podman run -td $IMAGE /bin/sh
|
||||
cid="$output"
|
||||
|
||||
is "$(check_exec_pid)" "" "exec pid hash file indeed doesn't exist"
|
||||
|
||||
for i in {1..3}; do
|
||||
run_podman exec $cid /bin/true
|
||||
done
|
||||
|
||||
is "$(check_exec_pid)" "" "there isn't any exec pid hash file leak"
|
||||
|
||||
run_podman stop --time 1 $cid
|
||||
run_podman rm -f $cid
|
||||
}
|
||||
|
||||
# vim: filetype=sh
|
||||
|
|
|
|||
|
|
@ -373,5 +373,19 @@ function random_string() {
|
|||
head /dev/urandom | tr -dc a-zA-Z0-9 | head -c$length
|
||||
}
|
||||
|
||||
|
||||
#########################
|
||||
# find_exec_pid_files # Returns nothing or exec_pid hash files
|
||||
#########################
|
||||
#
|
||||
# Return exec_pid hash files if exists, otherwise, return nothing
|
||||
#
|
||||
function find_exec_pid_files() {
|
||||
run_podman info --format '{{.store.RunRoot}}'
|
||||
local storage_path="$output"
|
||||
if [ -d $storage_path ]; then
|
||||
find $storage_path -type f -iname 'exec_pid_*'
|
||||
fi
|
||||
}
|
||||
# END miscellaneous tools
|
||||
###############################################################################
|
||||
|
|
|
|||
Loading…
Reference in New Issue