summaryrefslogtreecommitdiffhomepage
path: root/test/util/fuchsia_capability_util.h
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2021-08-11 18:18:36 -0700
committergVisor bot <gvisor-bot@google.com>2021-08-11 18:21:40 -0700
commitd51bc877f40d2acbf5b83895f636186c87463ab1 (patch)
treea3dcf26bcd3f05994df22cd359b2b4ac6503da55 /test/util/fuchsia_capability_util.h
parenta50596874a4971167f97a05181363e91292a2885 (diff)
Run packet socket tests on Fuchsia
+ Do not check for CAP_NET_RAW on Fuchsia Fuchsia does not support capabilities the same way Linux does. Instead emulate the check for CAP_NET_RAW by checking if a packet socket may be created. Bug: https://fxbug.dev/79016, https://fxbug.dev/81592 PiperOrigin-RevId: 390263666
Diffstat (limited to 'test/util/fuchsia_capability_util.h')
-rw-r--r--test/util/fuchsia_capability_util.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/test/util/fuchsia_capability_util.h b/test/util/fuchsia_capability_util.h
deleted file mode 100644
index 87657d7e8..000000000
--- a/test/util/fuchsia_capability_util.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2021 The gVisor Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Utilities for testing capabilities on Fuchsia.
-
-#ifndef GVISOR_TEST_UTIL_FUCHSIA_CAPABILITY_UTIL_H_
-#define GVISOR_TEST_UTIL_FUCHSIA_CAPABILITY_UTIL_H_
-
-#ifdef __Fuchsia__
-
-#include "test/util/posix_error.h"
-
-#ifdef CAP_NET_RAW
-#error "Fuchsia should not define CAP_NET_RAW"
-#endif // CAP_NET_RAW
-#define CAP_NET_RAW 0
-
-namespace gvisor {
-namespace testing {
-
-// HaveCapability returns true if the process has the specified EFFECTIVE
-// capability.
-PosixErrorOr<bool> HaveCapability(int cap);
-
-} // namespace testing
-} // namespace gvisor
-
-#endif // __Fuchsia__
-
-#endif // GVISOR_TEST_UTIL_FUCHSIA_CAPABILITY_UTIL_H_