summaryrefslogtreecommitdiffhomepage
path: root/test/runner
diff options
context:
space:
mode:
authorRahat Mahmood <rahat@google.com>2020-06-15 01:08:00 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-15 01:09:38 -0700
commitf23f62c2c2bcfb3196b67e64b4a73f820f150caa (patch)
tree3802ce878bbca58f830bfebe180fc34c1252ac80 /test/runner
parent3b5eaad3c8b49367d1812dbaf4182fc7282b7f00 (diff)
Correctly set the test VFS environment variable.
Also fix test bugs uncovered now that they aren't silently skipped on VFS2. Updates #1487. PiperOrigin-RevId: 316415807
Diffstat (limited to 'test/runner')
-rw-r--r--test/runner/runner.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/runner/runner.go b/test/runner/runner.go
index 332f1df89..f8baf61b0 100644
--- a/test/runner/runner.go
+++ b/test/runner/runner.go
@@ -352,11 +352,15 @@ func runTestCaseRunsc(testBin string, tc gtest.TestCase, t *testing.T) {
// Set environment variables that indicate we are running in gVisor with
// the given platform, network, and filesystem stack.
- // TODO(gvisor.dev/issue/1487): Update this when the runner supports VFS2.
platformVar := "TEST_ON_GVISOR"
networkVar := "GVISOR_NETWORK"
+ env := append(os.Environ(), platformVar+"="+*platform, networkVar+"="+*network)
vfsVar := "GVISOR_VFS"
- env := append(os.Environ(), platformVar+"="+*platform, networkVar+"="+*network, vfsVar+"=VFS1")
+ if *vfs2 {
+ env = append(env, vfsVar+"=VFS2")
+ } else {
+ env = append(env, vfsVar+"=VFS1")
+ }
// Remove env variables that cause the gunit binary to write output
// files, since they will stomp on eachother, and on the output files