mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
35 lines
581 B
Bash
Executable File
35 lines
581 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
. $(pwd)/common.sh
|
|
|
|
printf "Test that we create TMPDIR and propagate that variable intact"
|
|
|
|
cat >$TMP/echotest <<EOF
|
|
#!/bin/sh
|
|
echo \$TMPDIR
|
|
EOF
|
|
chmod a+x $TMP/echotest
|
|
|
|
cat >$TMP/unrestricted <<EOF
|
|
@unrestricted
|
|
EOF
|
|
|
|
export TMPDIR="$(mktemp -du /tmp/snaps/XXXXXX)/foo/bar"
|
|
test ! -e "$TMPDIR" # just sanity checking
|
|
|
|
OUTPUT="$($L appname unrestricted $TMP/echotest)"
|
|
|
|
if [ ! -d "$TMPDIR" ]; then
|
|
# we didn't create TMPDIR like we should have
|
|
FAIL
|
|
fi
|
|
|
|
if [ "$TMPDIR" != "$OUTPUT" ]; then
|
|
# we didn't propagate TMPDIR to the command
|
|
FAIL
|
|
fi
|
|
|
|
PASS
|