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:
bin
2021-08-16 12:59:03 +08:00
parent 9bbaa66f39
commit 2abc450a4d
12 changed files with 74 additions and 20 deletions

View File

@@ -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"
}