Signed-off-by: Masatake YAMATO <yamato@redhat.com>
ts_cd "$TS_OUTDIR"
PID=
FD=4
+RC=
{
coproc MKFDS { "$TS_HELPER_MKFDS" --comm ABC userns $FD; }
echo DONE >&"${MKFDS[1]}"
fi
wait "${MKFDS_PID}"
+ RC=$?
} > $TS_OUTPUT 2>&1
-if [ "$?" == "$EPERM" ]; then
+if [ "$RC" == "$EPERM" ]; then
ts_skip "unshare(2) is not permitted on this platform"
fi
ts_finalize
PID_UNUSED=
NETNS=
+RC=
{
coproc MKFDS { "$TS_HELPER_MKFDS" foreign-sockets 3 4; }
fi
wait "${MKFDS_PID}"
+ RC=$?
} > $TS_OUTPUT 2>&1
-if [[ "$?" == "$EPERM" ]]; then
+if [[ "$RC" == "$EPERM" ]]; then
ts_skip "unshare(2) is not permitted on this platform"
fi
ts_finalize
local column=$1
local eval_func=eval_"$column"
local O
+ local rc
ts_init_subtest "$1"
- if O=$($TS_CMD_LSNS --raw --noheadings --filter "NETNSID == '$NETNSID'" --output $1); then
+ O=$($TS_CMD_LSNS --raw --noheadings --filter "NETNSID == '$NETNSID'" --output $1)
+ rc=$?
+ if [[ $rc -eq 0 ]]; then
if "$eval_func" "$O"; then
echo OK
else
echo "$O"
fi
else
- echo ERROR $?
+ echo ERROR $rc
fi > "$TS_OUTPUT" 2>&1
ts_finalize_subtest
}