From 4bded6e58b67841fbff0ffe69258d7382d2c8a1f Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Mon, 27 Apr 2015 17:19:35 +0200 Subject: [PATCH] functional tests: Change $TMPDIR to ^TMPDIR^ This is to avoid confusion - $TMPDIR is replaced before the command is ran. Also, it's more consistent - we use this format for RKT_BIN. --- tests/rkt_volume_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/rkt_volume_test.go b/tests/rkt_volume_test.go index c822582..c15ec1f 100644 --- a/tests/rkt_volume_test.go +++ b/tests/rkt_volume_test.go @@ -36,11 +36,11 @@ var volTests = []struct { }, // Check that we can read files from a volume (both ro and rw) { - `/bin/sh -c "export FILE=/dir1/file ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=$TMPDIR ./rkt-inspect-vol-rw-read-file.aci"`, + `/bin/sh -c "export FILE=/dir1/file ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=^TMPDIR^ ./rkt-inspect-vol-rw-read-file.aci"`, `<<>>`, }, { - `/bin/sh -c "export FILE=/dir1/file ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=$TMPDIR ./rkt-inspect-vol-ro-read-file.aci"`, + `/bin/sh -c "export FILE=/dir1/file ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=^TMPDIR^ ./rkt-inspect-vol-ro-read-file.aci"`, `<<>>`, }, // Check that we can write to files in the ACI @@ -50,16 +50,16 @@ var volTests = []struct { }, // Check that we can write files to a volume (both ro and rw) { - `/bin/sh -c "export FILE=/dir1/file CONTENT=2 ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=$TMPDIR ./rkt-inspect-vol-rw-write-file.aci"`, + `/bin/sh -c "export FILE=/dir1/file CONTENT=2 ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=^TMPDIR^ ./rkt-inspect-vol-rw-write-file.aci"`, `<<<2>>>`, }, { - `/bin/sh -c "export FILE=/dir1/file CONTENT=3 ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=$TMPDIR ./rkt-inspect-vol-ro-write-file.aci"`, + `/bin/sh -c "export FILE=/dir1/file CONTENT=3 ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=^TMPDIR^ ./rkt-inspect-vol-ro-write-file.aci"`, `Cannot write to file "/dir1/file": open /dir1/file: read-only file system`, }, // Check that the volume still contain the file previously written { - `/bin/sh -c "export FILE=/dir1/file ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=$TMPDIR ./rkt-inspect-vol-ro-read-file.aci"`, + `/bin/sh -c "export FILE=/dir1/file ; ^RKT_BIN^ --debug --insecure-skip-verify run --inherit-env=true --volume=dir1,kind=host,source=^TMPDIR^ ./rkt-inspect-vol-ro-read-file.aci"`, `<<<2>>>`, }, } @@ -93,7 +93,7 @@ func TestVolumes(t *testing.T) { } for i, tt := range volTests { - cmd := strings.Replace(tt.rktCmd, "$TMPDIR", tmpdir, -1) + cmd := strings.Replace(tt.rktCmd, "^TMPDIR^", tmpdir, -1) cmd = strings.Replace(cmd, "^RKT_BIN^", ctx.cmd(), -1) t.Logf("Running test #%v: %v", i, cmd)