localgrouptestutils

package
v0.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package localgrouptestutils export users test functionalities used by other packages to change cmdline and group file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthdIntegrationTestsEnvWithGpasswdMock

func AuthdIntegrationTestsEnvWithGpasswdMock(t *testing.T, outputFilePath, groupsFilePath string) []string

AuthdIntegrationTestsEnvWithGpasswdMock returns the environment to pass to the authd daemon to use the gpasswd mock. In order to enable it, the authd binary must be built with the tag integrationtests. You need to install a TestMockgpasswd (generally calling Mockgpasswd) in your integration tests files.

func Mockgpasswd

func Mockgpasswd(_ *testing.T)

Mockgpasswd is the gpasswd mock.

func RequireGPasswdOutput

func RequireGPasswdOutput(t *testing.T, destCmdsFile, goldenGpasswdPath string)

RequireGPasswdOutput compare the output of gpasswd with the golden file.

func SetGpasswdCmd

func SetGpasswdCmd(gpasswdCmd []string)

SetGpasswdCmd sets the gpasswdCmd for the defaultOptions. Tests using this can't be run in parallel.

func SetGroupPath

func SetGroupPath(groupPath string)

SetGroupPath sets the groupPath for the defaultOptions. Tests using this can't be run in parallel.

func SetupGPasswdMock

func SetupGPasswdMock(t *testing.T, groupsFilePath string) string

SetupGPasswdMock setup the gpasswd mock and return the path to the file where the commands will be written.

Tests that require this can not be run in parallel.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL