summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/link.cc
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2019-09-16 11:56:59 -0700
committergVisor bot <gvisor-bot@google.com>2019-09-16 11:58:27 -0700
commit56cb0042181cc4840d8c3995f0970c0c41d4212b (patch)
tree4c755f1fe2d2252a55798ef2c2ec4e908cf88c5c /test/syscalls/linux/link.cc
parent010b0932583711ab3f6a88b1136cf8d87c2a53d2 (diff)
Migrate from gflags to absl flags
absl flags are more modern and we can easily depend on them directly. The repo now successfully builds with --incompatible_load_cc_rules_from_bzl. PiperOrigin-RevId: 269387081
Diffstat (limited to 'test/syscalls/linux/link.cc')
-rw-r--r--test/syscalls/linux/link.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/syscalls/linux/link.cc b/test/syscalls/linux/link.cc
index a91703070..dd5352954 100644
--- a/test/syscalls/linux/link.cc
+++ b/test/syscalls/linux/link.cc
@@ -22,6 +22,7 @@
#include <string>
#include "gtest/gtest.h"
+#include "absl/flags/flag.h"
#include "absl/strings/str_cat.h"
#include "test/util/capability_util.h"
#include "test/util/file_descriptor.h"
@@ -31,7 +32,7 @@
#include "test/util/test_util.h"
#include "test/util/thread_util.h"
-DEFINE_int32(scratch_uid, 65534, "scratch UID");
+ABSL_FLAG(int32_t, scratch_uid, 65534, "scratch UID");
namespace gvisor {
namespace testing {
@@ -92,7 +93,8 @@ TEST(LinkTest, PermissionDenied) {
// threads have the same UIDs, so using the setuid wrapper sets all threads'
// real UID.
// Also drops capabilities.
- EXPECT_THAT(syscall(SYS_setuid, FLAGS_scratch_uid), SyscallSucceeds());
+ EXPECT_THAT(syscall(SYS_setuid, absl::GetFlag(FLAGS_scratch_uid)),
+ SyscallSucceeds());
EXPECT_THAT(link(oldfile.path().c_str(), newname.c_str()),
SyscallFailsWithErrno(EPERM));