Skip to content

Commit

Permalink
Move some tests from imagevalidation to packagevalidation (#880)
Browse files Browse the repository at this point in the history
* Move some tests from imagevalidation to packagevalidation

* Convert imagevalidation to hostnamevalidation

* gofmt

* Rename image validation test go file
  • Loading branch information
koln67 authored Oct 20, 2023
1 parent 4c231e9 commit df09495
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 11 deletions.
11 changes: 8 additions & 3 deletions imagetest/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import (
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/cvm"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/disk"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/hostnamevalidation"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/hotattach"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/imageboot"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/imagevalidation"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/metadata"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/network"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/networkperf"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/oslogin"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/packagevalidation"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/security"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/shapevalidation"
"github.com/GoogleCloudPlatform/guest-test-infra/imagetest/test_suites/sql"
Expand Down Expand Up @@ -139,8 +140,8 @@ func main() {
networkperf.TestSetup,
},
{
imagevalidation.Name,
imagevalidation.TestSetup,
hostnamevalidation.Name,
hostnamevalidation.TestSetup,
},
{
imageboot.Name,
Expand All @@ -166,6 +167,10 @@ func main() {
shapevalidation.Name,
shapevalidation.TestSetup,
},
{
packagevalidation.Name,
packagevalidation.TestSetup,
},
{
storageperf.Name,
storageperf.TestSetup,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build cit
// +build cit

package imagevalidation
package hostnamevalidation

import (
"crypto/md5"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build cit
// +build cit

package imagevalidation
package hostnamevalidation

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package imagevalidation
package hostnamevalidation

import "github.com/GoogleCloudPlatform/guest-test-infra/imagetest"

// Name is the name of the test package. It must match the directory name.
var Name = "imagevalidation"
var Name = "hostnamevalidation"

// TestSetup sets up the test workflow.
func TestSetup(t *imagetest.TestWorkflow) error {
vm1, err := t.CreateTestVM("vm1")
if err != nil {
return err
}
vm1.RunTests("TestHostname|TestFQDN|TestHostKeysGeneratedOnce|TestArePackagesLegal|TestStandardPrograms|TestGuestPackages|TestNTPService|TestHostsFile")
vm1.RunTests("TestHostname|TestFQDN|TestHostKeysGeneratedOnce|TestHostsFile")

vm2, err := t.CreateTestVM("vm2.custom.domain")
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build cit
// +build cit

package imagevalidation
package packagevalidation

import (
"os/exec"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build cit
// +build cit

package imagevalidation
package packagevalidation

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build cit
// +build cit

package imagevalidation
package packagevalidation

import (
"bytes"
Expand Down
17 changes: 17 additions & 0 deletions imagetest/test_suites/packagevalidation/setup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package packagevalidation

import "github.com/GoogleCloudPlatform/guest-test-infra/imagetest"

// Name is the name of the test package. It must match the directory name.
var Name = "packagevalidation"

// TestSetup sets up the test workflow.
func TestSetup(t *imagetest.TestWorkflow) error {
vm1, err := t.CreateTestVM("vm1")
if err != nil {
return err
}
vm1.RunTests("TestArePackagesLegal|TestStandardPrograms|TestGuestPackages|TestNTPService")

return nil
}

0 comments on commit df09495

Please sign in to comment.