Skip to content

Commit

Permalink
kola torcx deprecation: fix gofmt errors
Browse files Browse the repository at this point in the history
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
  • Loading branch information
t-lo committed Oct 13, 2023
1 parent e26de57 commit c48fb8b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 deletions.
3 changes: 1 addition & 2 deletions kola/tests/bpf/bpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ func execsnoopTest(c cluster.TestCluster) {
_ = c.MustSSH(m, fmt.Sprintf("docker logs %s", containerName))
_ = c.MustSSH(m, fmt.Sprintf("docker top %s", containerName))


plog.Infof("getting logs from %s container", containerName)
if err := util.Retry(10, 2*time.Second, func() error {
logs, err := c.SSH(m, fmt.Sprintf("sudo cat $(docker inspect --format='{{.LogPath}}' %s)", containerName))
if err != nil {
c.Fatalf("unable to run SSH command: %v", err)
}
dockerLogs:= bytes.Split(logs, []byte("\n"))
dockerLogs := bytes.Split(logs, []byte("\n"))

// we have the headers of the table
// then 2 lines for docker ps and the torcx call if torcx is used
Expand Down
9 changes: 4 additions & 5 deletions kola/tests/docker/enable_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.


// This test originated as torcx test and is kept to shield against
// similar activation issues with sysext.

Expand All @@ -37,8 +36,8 @@ func init() {
Run: dockerEnable,
ClusterSize: 1,
// This test is normally not related to the cloud environment
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "docker.enable-service.torcx",
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "docker.enable-service.torcx",
EndVersion: semver.Version{Major: 3745},
UserData: conf.Butane(`
variant: flatcar
Expand All @@ -55,8 +54,8 @@ systemd:
Run: dockerEnable,
ClusterSize: 1,
// This test is normally not related to the cloud environment
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "docker.enable-service.sysext",
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "docker.enable-service.sysext",
MinVersion: semver.Version{Major: 3746},
UserData: conf.Butane(`
variant: flatcar
Expand Down
8 changes: 4 additions & 4 deletions kola/tests/docker/torcx_manifest_pkgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func init() {
// This test is normally not related to the cloud environment
Platforms: []string{"qemu", "qemu-unpriv"},
SkipFunc: func(version semver.Version, channel, arch, platform string) bool {
// Releases after 3745 don't ship torcx at all (these use sysext)
if ( 0 < version.Compare(semver.Version{Major: 3745}) ) {
return true
}
// Releases after 3745 don't ship torcx at all (these use sysext)
if (0 < version.Compare(semver.Version{Major: 3745})) {
return true
}
// LTS (3033) does not have the network-kargs service pulled in:
// https://github.com/flatcar/coreos-overlay/pull/1848/commits/9e04bc12c3c7eb38da05173dc0ff7beaefa13446
// Let's skip this test for < 3034 on ESX.
Expand Down
9 changes: 4 additions & 5 deletions kola/tests/sysext/disable_containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.


package sysext

import (
Expand All @@ -26,9 +25,9 @@ func init() {
register.Register(&register.Test{
Run: containerdDisable,
ClusterSize: 1,
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "sysext.disable-containerd",
// Only releases after 3745 ship sysext
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "sysext.disable-containerd",
// Only releases after 3745 ship sysext
MinVersion: semver.Version{Major: 3746},
UserData: conf.Butane(`
variant: flatcar
Expand All @@ -47,7 +46,7 @@ storage:
func containerdDisable(c cluster.TestCluster) {
m := c.Machines()[0]
output := c.MustSSH(m,
`test ! -f /usr/bin/containerd || echo "ERROR"`)
`test ! -f /usr/bin/containerd || echo "ERROR"`)
if string(output) == "ERROR" {
c.Errorf("/usr/bin/containerd exists even when sysext is disabled!")
}
Expand Down
9 changes: 4 additions & 5 deletions kola/tests/sysext/disable_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.


package sysext

import (
Expand All @@ -26,9 +25,9 @@ func init() {
register.Register(&register.Test{
Run: dockerDisable,
ClusterSize: 1,
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "sysext.disable-docker",
// Only releases after 3745 ship sysext
Platforms: []string{"qemu", "qemu-unpriv"},
Name: "sysext.disable-docker",
// Only releases after 3745 ship sysext
MinVersion: semver.Version{Major: 3746},
UserData: conf.Butane(`
variant: flatcar
Expand All @@ -47,7 +46,7 @@ storage:
func dockerDisable(c cluster.TestCluster) {
m := c.Machines()[0]
output := c.MustSSH(m,
`test ! -f /usr/bin/docker || echo "ERROR"`)
`test ! -f /usr/bin/docker || echo "ERROR"`)
if string(output) == "ERROR" {
c.Errorf("/usr/bin/docker exists even when sysext is disabled!")
}
Expand Down
2 changes: 1 addition & 1 deletion kola/tests/systemd/journald.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func journalUser(c cluster.TestCluster) {
}

if strings.Contains(string(log), "Foo") {
return nil;
return nil
}

return fmt.Errorf("Waiting for log output...")
Expand Down

0 comments on commit c48fb8b

Please sign in to comment.