Enumerations
enum AccessType
| Name | Value |
|---|---|
| Read | 0 |
| Write | 1 |
Defined at line 528 of file ../../src/starnix/tests/syscalls/cpp/test_helper.h
Records
-
class CloneHelper -
class EventFdSem -
class ForkHelper -
class ForkResult -
class Holder -
class MemoryMapping -
class MemoryMappingExt -
class MountInfo -
class NetlinkEncoder -
class Poker -
class Rendezvous -
class ScopedMMap -
class ScopedMount -
class ScopedPipe -
class ScopedTempDir -
class ScopedTempFD -
class ScopedTempSymlink -
class SignalMaskHelper
Functions
-
void DropAllCapabilities ()Drops all capabilities from the effective, permitted, and inheritable sets.
Defined at line 18 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
bool HasCapability (int cap)Checks if a capability is in the effective set.
Defined at line 27 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void UnsetCapability (int cap)Unsets a capability from the effective set.
Defined at line 30 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
bool HasCapabilityEffective (int cap)Checks whether a capability is in the thread's effective set.
Defined at line 33 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
bool HasCapabilityPermitted (int cap)Checks whether a capability is in the thread's permitted set.
Defined at line 43 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
bool HasCapabilityInheritable (int cap)Checks whether a capability is in the thread's inheritable set.
Defined at line 53 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
bool HasCapabilityAmbient (int cap)Checks whether a capability is in the thread's ambient set.
Defined at line 62 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
bool HasCapabilityBounding (int cap)Checks whether a capability is in the thread's bounding set.
Defined at line 66 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void UnsetCapabilityEffective (int cap)Removes a capability from the thread's effective set.
Defined at line 69 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void UnsetCapabilityPermitted (int cap)Removes a capability from the thread's permitted set.
Defined at line 80 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void UnsetCapabilityInheritable (int cap)Removes a capability from the thread's inheritable set.
Defined at line 91 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void UnsetCapabilityAmbient (int cap)Removes a capability from the thread's ambient set.
Defined at line 102 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void UnsetCapabilityBounding (int cap)Removes a capability from the thread's bounded set.
Defined at line 107 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void DropAllAmbientCapabilities ()Drops all capabilities from the ambient set.
Defined at line 147 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void SetCapabilityEffective (int cap)Sets a capability in the thread's effective set.
Defined at line 110 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void SetCapabilityPermitted (int cap)Sets a capability in the thread's permitted set.
Defined at line 121 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void SetCapabilityInheritable (int cap)Sets a capability in the thread's inheritable set.
Defined at line 132 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void SetCapabilityAmbient (int cap)Sets a capability in the thread's ambient set.
Defined at line 143 of file ../../src/starnix/tests/syscalls/cpp/capabilities_helper.cc
-
void SetCapabilityBounding (int cap)Sets a capability in the thread's bounding set.
-
void waitForChildSucceeds (unsigned intwaitFlag,intcloneFlags,int (*)(void *)childRunFunction,int (*)(void *)parentRunFunction)Defined at line 317 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
void waitForChildFails (unsigned intwaitFlag,intcloneFlags,int (*)(void *)childRunFunction,int (*)(void *)parentRunFunction)Defined at line 333 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::string get_tmp_path ()Defined at line 347 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::string GetTestResourcePath (const std::string & resource)Returns the path to a test resource.
Looks for the resource under "data/tests/deps" first. If not found, looks for it in the same
directory as the current executable.
Defined at line 357 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::ostream & operator<< (std::ostream & os, const MemoryMappingExt & mapping)Defined at line 504 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::optional<size_t> parse_field_in_kb (std::string_view value)Defined at line 421 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::optional<MemoryMapping> find_memory_mapping (fit::function<bool (const MemoryMapping &)> match, std::string_view maps)Returns the first memory mapping that matches the given predicate.
Defined at line 435 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::optional<MemoryMapping> find_memory_mapping (uintptr_t addr, std::string_view maps)Defined at line 452 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::optional<MemoryMappingExt> find_memory_mapping_ext (fit::function<bool (const MemoryMappingExt &)> match, std::string_view maps)Same as above, but with info from smaps
Defined at line 458 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::optional<MemoryMappingExt> find_memory_mapping_ext (uintptr_t addr, std::string_view maps)Defined at line 496 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::string RandomHexString (size_t length)Returns a random hex string of the given length.
Defined at line 520 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
bool HasSysAdmin ()Returns true if running with sysadmin capabilities.
Defined at line 532 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
bool HasCapability (uint32_t cap)Returns true if running with the given capability.
-
bool IsStarnix ()Returns true if running on Starnix. This is likely only necessary when there are known bugs.
Defined at line 534 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
bool IsKernelVersionAtLeast (int min_major, int min_minor)Returns true if reported kernel version is equal or greater than a given one.
Defined at line 539 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
void RecursiveUnmountAndRemove (const std::string & path)Unmount anything mounted at or under `path` and remove it.
Defined at line 551 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
bool TryRead (uintptr_t addr)Attempts to read a byte from the given memory address.
Returns whether the read succeeded or not.
Defined at line 622 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
bool TryWrite (uintptr_t addr)Attempts to write a zero byte to the given memory address.
Returns whether the write succeeded or not.
Defined at line 631 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
int MemFdCreate (const char * name, unsigned int flags)Wrapper for the memfd_create system call.
Defined at line 612 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
int PidFdOpen (pid_t pid, unsigned int flags)Wrapper for the pidfd_open system call.
Defined at line 616 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
testing::AssertionResult WaitUntilBlocked (pid_t target, bool ignore_tracer)Wait until the target process indicates a sleeping (S) or traced sleeping (t) state.
Defined at line 638 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
testing::AssertionResult WaitUntilZombie (pid_t target)Wait until the target process indicates a zombie (Z) state.
Defined at line 644 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
testing::AssertionResult WaitForTaskState (pid_tpid,pid_ttid,fit::function<bool (std::string_view)>predicate)Loop until the target task's process state in /proc/
<pid
>/task/
<tid
>/stat satisfies the given
predicate function. The string passed to the predicate is the task state (R, S, T, Z, etc.).
Defined at line 649 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
testing::AssertionResult TestThatAccessSegfaults (void * test_address, AccessType type)Checks whether the provided access segfaults.
Defined at line 673 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
Rendezvous MakeRendezvous ()Constructs a new pipe-backed `Poker`-`Holder` pair for synchronization of two
threads or processes.
Defined at line 787 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
Rendezvous MakeRendezvous (ScopedPipe pipe)Constructs a `Poker`-`Holder` pair from an existing pipe.
Defined at line 789 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
fit::result<int, std::vector<MountInfo>> ReadMountInfo ()Reads and parses "/proc/self/mountinfo".
Defined at line 796 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc
-
std::optional<MountInfo> ReadMountInfoLine (const std::string & path)Reads "/proc/self/mountinfo" and returns the info for the mount at `path`.
If no such mount is found, or the file cannot be read, the result will be an empty optional.
Defined at line 842 of file ../../src/starnix/tests/syscalls/cpp/test_helper.cc