mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-19 07:14:22 +01:00
test: enable running tests under root user
Add tests that run under root user to test special cases. Fixes: #2446 Signed-off-by: bin <bin@hyper.sh>
This commit is contained in:
@@ -6,7 +6,10 @@
|
||||
|
||||
package katatestutils
|
||||
|
||||
import "strconv"
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type RuntimeConfigOptions struct {
|
||||
Hypervisor string
|
||||
@@ -150,3 +153,8 @@ func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
|
||||
jaeger_user= "` + config.JaegerUser + `"
|
||||
jaeger_password= "` + config.JaegerPassword + `"`
|
||||
}
|
||||
|
||||
func IsInGitHubActions() bool {
|
||||
// https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
|
||||
return os.Getenv("GITHUB_ACTIONS") == "true"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user