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:
parent
b109ec878e
commit
0041ae5655
6 changed files with 74 additions and 70 deletions
32
cmd/osbuild-image-tests/constants/constants-travis.go
Normal file
32
cmd/osbuild-image-tests/constants/constants-travis.go
Normal 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",
|
||||
}
|
||||
28
cmd/osbuild-image-tests/constants/constants.go
Normal file
28
cmd/osbuild-image-tests/constants/constants.go
Normal 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",
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue