mirror of
https://github.com/clearlinux/rkt.git
synced 2026-08-21 14:47:15 +00:00
3f1d704716
The functional tests use sudo because the tests need to be run as root. Sudo does not preserve $PATH. When the user use a home-built go, it might have a different version thatn the system-wide installed go. It causes problems when linking the tests with github.com/coreos/rkt/common This patch fixes the issue by using the go environment of the user.
23 lines
778 B
Bash
Executable File
23 lines
778 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# This script is normally executed by ./test in the topdir source directory.
|
|
# In this case, $GOPATH is already set.
|
|
#
|
|
# However, when developing a new functional test, it is useful to run the
|
|
# tests manually without recompiling rkt. GOPATH is set to the same directory
|
|
# as ./build in the topdir source directory does.
|
|
#
|
|
# To run all tests:
|
|
# $ cd tests && ./test
|
|
#
|
|
# To run only one test:
|
|
# $ cd tests && ./test -run=TestEnv
|
|
|
|
# Sudo does not preserve $PATH. Use go from the user's $PATH instead of
|
|
# root's $PATH. It is needed when a home-built go does not have the same
|
|
# version as the system-wide installed go.
|
|
GO=`which go`
|
|
|
|
sudo GOPATH="${PWD}/../gopath" RKT_ENABLE_DESTRUCTIVE_TESTS="$RKT_ENABLE_DESTRUCTIVE_TESTS" GOROOT="$GOROOT" $GO test -v $*
|
|
|