1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-22 08:25:38 +00:00

cli.test: passthrough and use TMPDIR

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2017-01-20 11:29:59 -05:00
parent d1073b349b
commit 235566d9e0
Signed by: vbatts
GPG key ID: 10937E57733F1362
8 changed files with 11 additions and 8 deletions

View file

@ -13,6 +13,9 @@ func main() {
failed := 0 failed := 0
for _, arg := range flag.Args() { for _, arg := range flag.Args() {
cmd := exec.Command("bash", arg) cmd := exec.Command("bash", arg)
if os.Getenv("TMPDIR") != "" {
cmd.Env = append(cmd.Env, "TMPDIR="+os.Getenv("TMPDIR"))
}
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {

View file

@ -4,7 +4,7 @@ set -e
name=$(basename $0) name=$(basename $0)
root="$(dirname $(dirname $(dirname $0)))" root="$(dirname $(dirname $(dirname $0)))"
gomtree=$(readlink -f ${root}/gomtree) gomtree=$(readlink -f ${root}/gomtree)
t=$(mktemp -d /tmp/go-mtree.XXXXXX) t=$(mktemp -t -d go-mtree.XXXXXX)
echo "[${name}] Running in ${t}" echo "[${name}] Running in ${t}"
# This test is for basic running check of manifest, and check against tar and file system # This test is for basic running check of manifest, and check against tar and file system

View file

@ -4,7 +4,7 @@ set -e
name=$(basename $0) name=$(basename $0)
root="$(dirname $(dirname $(dirname $0)))" root="$(dirname $(dirname $(dirname $0)))"
gomtree=$(readlink -f ${root}/gomtree) gomtree=$(readlink -f ${root}/gomtree)
t=$(mktemp -d /tmp/go-mtree.XXXXXX) t=$(mktemp -t -d go-mtree.XXXXXX)
echo "[${name}] Running in ${t}" echo "[${name}] Running in ${t}"
# This test is for basic running check of manifest, and check against tar and file system # This test is for basic running check of manifest, and check against tar and file system

View file

@ -4,7 +4,7 @@ set -e
name=$(basename $0) name=$(basename $0)
root="$(dirname $(dirname $(dirname $0)))" root="$(dirname $(dirname $(dirname $0)))"
gomtree=$(readlink -f ${root}/gomtree) gomtree=$(readlink -f ${root}/gomtree)
t=$(mktemp -d /tmp/go-mtree.XXXXXX) t=$(mktemp -t -d go-mtree.XXXXXX)
setfattr -n user.has.xattrs -v "true" "${t}" || exit 0 setfattr -n user.has.xattrs -v "true" "${t}" || exit 0

View file

@ -5,7 +5,7 @@ set -e
name=$(basename $0) name=$(basename $0)
root="$(dirname $(dirname $(dirname $0)))" root="$(dirname $(dirname $(dirname $0)))"
gomtree=$(readlink -f ${root}/gomtree) gomtree=$(readlink -f ${root}/gomtree)
t=$(mktemp -d /tmp/go-mtree.XXXXXX) t=$(mktemp -t -d go-mtree.XXXXXX)
echo "[${name}] Running in ${t}" echo "[${name}] Running in ${t}"

View file

@ -4,7 +4,7 @@ set -e
name=$(basename $0) name=$(basename $0)
root="$(dirname $(dirname $(dirname $0)))" root="$(dirname $(dirname $(dirname $0)))"
gomtree=$(readlink -f ${root}/gomtree) gomtree=$(readlink -f ${root}/gomtree)
t=$(mktemp -d /tmp/go-mtree.XXXXXX) t=$(mktemp -t -d go-mtree.XXXXXX)
echo "[${name}] Running in ${t}" echo "[${name}] Running in ${t}"

View file

@ -4,7 +4,7 @@ set -e
name=$(basename $0) name=$(basename $0)
root="$(dirname $(dirname $(dirname $0)))" root="$(dirname $(dirname $(dirname $0)))"
gomtree=$(readlink -f ${root}/gomtree) gomtree=$(readlink -f ${root}/gomtree)
t=$(mktemp -d /tmp/go-mtree.XXXXXX) t=$(mktemp -t -d go-mtree.XXXXXX)
echo "[${name}] Running in ${t}" echo "[${name}] Running in ${t}"
# This test is for basic running check of manifest, and check against tar and file system # This test is for basic running check of manifest, and check against tar and file system

View file

@ -4,8 +4,8 @@ set -e
name=$(basename $0) name=$(basename $0)
root="$(dirname $(dirname $(dirname $0)))" root="$(dirname $(dirname $(dirname $0)))"
gomtree=$(readlink -f ${root}/gomtree) gomtree=$(readlink -f ${root}/gomtree)
left=$(mktemp -d /tmp/go-mtree.XXXXXX) left=$(mktemp -t -d go-mtree.XXXXXX)
right=$(mktemp -d /tmp/go-mtree.XXXXXX) right=$(mktemp -t -d go-mtree.XXXXXX)
echo "[${name}] Running in ${left} and ${right}" echo "[${name}] Running in ${left} and ${right}"