tests/image: move constants to a subpackage

The cmd/osbuild-image-tests package is becoming bigger than I would like to.
It will be nice to split it to some smaller pieces at some point.
This commit does the first step - splits off the first subpackage containing
all the constants.
This commit is contained in:
Ondřej Budai 2020-04-22 15:14:08 +02:00 committed by Tom Gundersen
parent b109ec878e
commit 0041ae5655
6 changed files with 74 additions and 70 deletions

View file

@ -0,0 +1,32 @@
// +build travis
package constants
import "os/exec"
func GetOsbuildCommand(store string) *exec.Cmd {
cmd := exec.Command(
"python3",
"-m", "osbuild",
"--libdir", ".",
"--store", store,
"--json",
"-",
)
cmd.Dir = "osbuild"
return cmd
}
var TestPaths = struct {
ImageInfo string
PrivateKey string
TestCasesDirectory string
UserData string
MetaData string
}{
ImageInfo: "tools/image-info",
PrivateKey: "test/keyring/id_rsa",
TestCasesDirectory: "test/cases",
UserData: "test/cloud-init/user-data",
MetaData: "test/cloud-init/meta-data",
}

View file

@ -0,0 +1,28 @@
// +build integration,!travis
package constants
import "os/exec"
func GetOsbuildCommand(store string) *exec.Cmd {
return exec.Command(
"osbuild",
"--store", store,
"--json",
"-",
)
}
var TestPaths = struct {
ImageInfo string
PrivateKey string
TestCasesDirectory string
UserData string
MetaData string
}{
ImageInfo: "/usr/libexec/osbuild-composer/image-info",
PrivateKey: "/usr/share/tests/osbuild-composer/keyring/id_rsa",
TestCasesDirectory: "/usr/share/tests/osbuild-composer/cases",
UserData: "/usr/share/tests/osbuild-composer/cloud-init/user-data",
MetaData: "/usr/share/tests/osbuild-composer/cloud-init/meta-data",
}