diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-15 12:14:42 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-15 12:14:42 -0700 |
commit | 8939fae0af9dc8e1cdf2553339fee35b684fc828 (patch) | |
tree | 95224138ca159fd3c6b9d32eaf6c1930c1dfd6ff /test/util | |
parent | fc48ace73aea9294c9f4ee881950d836715bf4d7 (diff) | |
parent | abffebde7be2dcdb4564e45f845d7c150ced0ccb (diff) |
Merge pull request #3165 from ridwanmsharif:ridwanmsharif/fuse-off-by-default
PiperOrigin-RevId: 321411758
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/test_util.cc | 6 | ||||
-rw-r--r-- | test/util/test_util.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/test/util/test_util.cc b/test/util/test_util.cc index 8a037f45f..d0c1d6426 100644 --- a/test/util/test_util.cc +++ b/test/util/test_util.cc @@ -42,6 +42,7 @@ namespace testing { constexpr char kGvisorNetwork[] = "GVISOR_NETWORK"; constexpr char kGvisorVfs[] = "GVISOR_VFS"; +constexpr char kFuseEnabled[] = "FUSE_ENABLED"; bool IsRunningOnGvisor() { return GvisorPlatform() != Platform::kNative; } @@ -68,6 +69,11 @@ bool IsRunningWithVFS1() { return strcmp(env, "VFS1") == 0; } +bool IsFUSEEnabled() { + const char* env = getenv(kFuseEnabled); + return env && strcmp(env, "TRUE") == 0; +} + // Inline cpuid instruction. Preserve %ebx/%rbx register. In PIC compilations // %ebx contains the address of the global offset table. %rbx is occasionally // used to address stack variables in presence of dynamic allocas. diff --git a/test/util/test_util.h b/test/util/test_util.h index 0f9781038..373c54f32 100644 --- a/test/util/test_util.h +++ b/test/util/test_util.h @@ -225,6 +225,7 @@ const std::string GvisorPlatform(); bool IsRunningWithHostinet(); // TODO(gvisor.dev/issue/1624): Delete once VFS1 is gone. bool IsRunningWithVFS1(); +bool IsFUSEEnabled(); #ifdef __linux__ void SetupGvisorDeathTest(); |