package
4.3.0-rc.1
Repository: https://github.com/sylabs/singularity.git
Documentation: pkg.go.dev

# Functions

AllProfiles is initialized to the union of NativeProfiles and OCIProfiles.
AsSubtest requests the command to be run as a subtest.
BusyboxImage will provide the path to a local busybox SIF image for the current architecture.
CheckCryptsetupVersion checks the version of cryptsetup and returns an error if the version is not compatible; nil otherwise.
ConsoleExpect reads from the console until the provided string is read or an error occurs.
ConsoleExpectf reads from the console until the provided formatted string is read or an error occurs.
ConsoleRun sets console operations to interact with the running command.
ConsoleSend writes a string to the console.
ConsoleSendLine writes a string to the console with a trailing newline.
CopyImage will copy an OCI image from source to destination.
CurrentUser returns the current user account information.
DefinitionImageVerify checks for image correctness based off of supplied DefFileDetail.
No description provided by the author
EnsureDockerArchive checks if e2e Docker test archive is available, and fetches it otherwise.
EnsureImage checks if e2e test image is already built or built it otherwise.
EnsureImage checks if e2e OCI test archive is available, and fetches it otherwise.
No description provided by the author
EnsureImage checks if e2e OCI-SIF file is available, and fetches it otherwise.
No description provided by the author
No description provided by the author
No description provided by the author
ExpectError tests if the command error stream match the pattern string based on the type of match.
ExpectErrorf tests if the command error stream match the pattern string based on the type of match.
ExpectExit is called once the command completed and before PostRun function in order to check the exit code returned.
ExpectOutput tests if the command output stream match the pattern string based on the type of match.
ExpectOutputf tests if the command output stream match the formatted string pattern based on the type of match.
GeneratePemFiles creates a new PEM file for testing purposes.
GetStreams gets command stdout and stderr result.
MakeCacheDir creates a temporary image cache directory that can then be used for the execution of a e2e test.
MakeSyPGPDir creates a temporary directory that will be used to store the PGP keyring for the execution of a e2e test.
MakeTempDir creates a temporary image cache directory that can then be used for the execution of a e2e test.
OrigGID returns the GID of the user running the test suite.
OrigUID returns the UID of the user running the test suite.
PathExists return true if the path (file or directory) exists, false otherwise.
PathPerms return true if the path (file or directory) has specified permissions, false otherwise.
PostRun sets a function to execute when the singularity command execution finished, this function is executed with privileges if the profile is either RootProfile or RootUserNamespaceProfile.
PrepareDefFile reads a template from a file, applies data to it, writes the contents to disk, and returns the path.
PrepareMultiStageDefFile reads a template from a file, applies data to it for each definition, concatenates them all together, writes them to a file and returns the path.
PreRun sets a function to execute before running the singularity command, this function is executed with privileges if the profile is either RootProfile or RootUserNamespaceProfile.
PrivateRepoLogin logs in to the private repo at env.TestRegistryPrivURI.
PrivateRepoLogout logs out of the private repo at env.TestRegistryPrivURI.
Privileged wraps the supplied test function with calls to ensure the test is run with elevated privileges applied to the current thread, and the current goroutine locked to this thread.
PullImage will pull a test image.
No description provided by the author
No description provided by the author
No description provided by the author
SetupHomeDirectories creates temporary home directories for privileged and unprivileged users and bind mount those directories on top of real ones.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ThreadSetresgid performs a syscall setting gid for the current thread only.
ThreadSetresuid performs a syscall setting uid for the current thread only.
WithArgs sets the singularity command arguments.
WithCommand sets the singularity command to execute.
WithDir sets the current working directory for the execution of a command.
WithEnv sets environment variables to use while running a singularity command.
WithGlobalOptions sets global singularity option (eg: --debug, --silent).
WithProfile sets the Singularity execution profile, this is a convenient way to automatically set requirements like privileges, arguments injection in order to execute Singularity command with the corresponding profile.
WithRootlessEnv passes through XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS for rootless operations that need these e.g.
WithStdin sets a reader to use as input data to pass to the singularity command.
WriteTempFile creates and populates a temporary file in the specified directory or in os.TempDir if dir is "" returns the file name or an error.

# Constants

ContainMatch is for contain match.
DefaultPassword is the default E2E password.
DefaultUsername is the default E2E username.
ExactMatch is for exact match.
Passphrase used for passphrase-based encryption tests.
RegexMatch is for regular expression match.
UnwantedContainMatch checks that output does not contain text.
UnwantedExactMatch checks that output does not exactly match text.

# Variables

FakerootProfile is the execution profile for fakeroot, using the Singularity native runtime.
NativeProfiles defines all available profiles for the native singularity runtime.
OCIFakerootProfile is the execution profile for fakeroot, using Singularity's OCI mode.
OCIProfiles defines all available profiles for the OCI runtime.
OCIRootProfile is the execution profile for root, using Singularity's OCI mode.
OCIUserProfile is the execution profile for a regular user, using Singularity's OCI mode.
RootProfile is the execution profile for root, using the Singularity native runtime.
RootUserNamespaceProfile is the execution profile for root and a user namespace, using the Singularity native runtime.
UserNamespaceProfile is the execution profile for a regular user and a user namespace, using the Singularity native runtime.
UserProfile is the execution profile for a regular user, using the Singularity native runtime.

# Structs

AppDetail describes an app.
BuildOpts define image build options.
DefFileDetails describes the sections of a definition file.
FilePair represents a source destination pair for file copying.
FileSection describes elements of %files section.
Profile represents various properties required to run an E2E test under a particular user profile.
SingularityCmdResult holds the result for a Singularity command execution test.
TestEnv stores all the information under the control of e2e test developers, from specifying which Singularity binary to use to controlling how Singularity environment variables will be set.

# Type aliases

MatchType defines the type of match for ExpectOuput and ExpectError functions.
SingularityCmdOp is a function type passed to RunCommand used to define the test execution context.
SingularityCmdResultOp is a function type executed by ExpectExit to process and test execution result.
SingularityConsoleOp is a function type passed to ConsoleRun to execute interactive commands.