Skip to content

Commit 7c73d05

Browse files
committed
use temp directory as destination directory for copy command
Signed-off-by: olalekan odukoya <odukoyaonline@gmail.com>
1 parent ccd3c0c commit 7c73d05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hack/test-templates.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,11 @@ if [ "$got" != "$expected" ]; then
192192
fi
193193

194194
INFO "Testing limactl copy command"
195-
tmpfile="$HOME/lima-hostname"
195+
tmpdir=$(mktemp -d /var/tmp/lima-test-templates.XXXXXX)
196+
defer "rm -rf \"$tmpdir\""
197+
tmpfile="$tmpdir/lima-hostname"
196198
rm -f "$tmpfile"
197199
limactl cp "$NAME":/etc/hostname "$tmpfile"
198-
defer "rm -f \"$tmpfile\""
199200
expected="$(limactl shell "$NAME" cat /etc/hostname)"
200201
got="$(cat "$tmpfile")"
201202
INFO "/etc/hostname: expected=${expected}, got=${got}"

0 commit comments

Comments
 (0)