Skip to content

Commit

Permalink
use temp directory as destination directory for copy command
Browse files Browse the repository at this point in the history
Signed-off-by: olalekan odukoya <[email protected]>
  • Loading branch information
olamilekan000 committed Jan 28, 2025
1 parent ccd3c0c commit 7c73d05
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hack/test-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@ if [ "$got" != "$expected" ]; then
fi

INFO "Testing limactl copy command"
tmpfile="$HOME/lima-hostname"
tmpdir=$(mktemp -d /var/tmp/lima-test-templates.XXXXXX)
defer "rm -rf \"$tmpdir\""
tmpfile="$tmpdir/lima-hostname"
rm -f "$tmpfile"
limactl cp "$NAME":/etc/hostname "$tmpfile"
defer "rm -f \"$tmpfile\""
expected="$(limactl shell "$NAME" cat /etc/hostname)"
got="$(cat "$tmpfile")"
INFO "/etc/hostname: expected=${expected}, got=${got}"
Expand Down

0 comments on commit 7c73d05

Please sign in to comment.