diff --git a/cli/kata-check_amd64_test.go b/cli/kata-check_amd64_test.go index 69e49083ab..8cb06167fb 100644 --- a/cli/kata-check_amd64_test.go +++ b/cli/kata-check_amd64_test.go @@ -484,13 +484,6 @@ func TestKvmIsUsable(t *testing.T) { assert.Error(err) } -type TestDataa struct { - contents string - expectedVendor string - expectedModel string - expectError bool -} - func TestGetCPUDetails(t *testing.T) { const validVendorName = "a vendor" validVendor := fmt.Sprintf(`%s : %s`, archCPUVendorField, validVendorName) @@ -505,7 +498,7 @@ foo : bar %s `, validVendor, validModel) - data := []TestDataa{ + data := []testCPUDetail{ {"", "", "", true}, {"invalid", "", "", true}, {archCPUVendorField, "", "", true}, diff --git a/cli/kata-check_ppc64le_test.go b/cli/kata-check_ppc64le_test.go index 6c1bd12996..e0267d768f 100644 --- a/cli/kata-check_ppc64le_test.go +++ b/cli/kata-check_ppc64le_test.go @@ -208,13 +208,6 @@ func TestKvmIsUsable(t *testing.T) { assert.Error(err) } -type TestDataa struct { - contents string - expectedVendor string - expectedModel string - expectError bool -} - func TestGetCPUDetails(t *testing.T) { const validVendorName = "" @@ -230,7 +223,7 @@ foo : bar %s `, validVendor, validModel) - data := []TestDataa{ + data := []testCPUDetail{ {"", "", "", true}, {"invalid", "", "", true}, {archCPUVendorField, "", "", true}, diff --git a/cli/kata-check_s390x_test.go b/cli/kata-check_s390x_test.go index 47b1b72291..d04b44a650 100644 --- a/cli/kata-check_s390x_test.go +++ b/cli/kata-check_s390x_test.go @@ -207,21 +207,7 @@ func TestKvmIsUsable(t *testing.T) { assert.Error(err) } -type TestDataa struct { - contents string - expectedVendor string - expectedModel string - expectError bool -} - func TestGetCPUDetails(t *testing.T) { - type testData struct { - contents string - expectedVendor string - expectedModel string - expectError bool - } - const validVendorName = "a vendor" validVendor := fmt.Sprintf(`%s : %s`, archCPUVendorField, validVendorName) @@ -235,7 +221,7 @@ foo : bar %s `, validVendor, validModel) - data := []TestDataa{ + data := []testCPUDetail{ {"", "", "", true}, {"invalid", "", "", true}, {archCPUVendorField, "", "", true}, diff --git a/cli/kata-check_test.go b/cli/kata-check_test.go index 441fb28f66..7c2cde4d59 100644 --- a/cli/kata-check_test.go +++ b/cli/kata-check_test.go @@ -33,6 +33,13 @@ type testCPUData struct { expectError bool } +type testCPUDetail struct { + contents string + expectedVendor string + expectedModel string + expectError bool +} + func createFile(file, contents string) error { return ioutil.WriteFile(file, []byte(contents), testFileMode) } @@ -138,7 +145,7 @@ func makeCPUInfoFile(path, vendorID, flags string) error { return ioutil.WriteFile(path, contents.Bytes(), testFileMode) } -func genericTestGetCPUDetails(t *testing.T, validVendor string, validModel string, validContents string, data []TestDataa) { +func genericTestGetCPUDetails(t *testing.T, validVendor string, validModel string, validContents string, data []testCPUDetail) { tmpdir, err := ioutil.TempDir("", "") if err != nil { panic(err)