From 1e926fc438fa4733916d96aaf0b43b5deaa67be1 Mon Sep 17 00:00:00 2001 From: wangyueliang Date: Thu, 20 Jun 2024 19:28:52 +0800 Subject: [PATCH] adjust some testcase for dockerhub not to be used --- mantle/kola/tests/coretest/core.go | 12 ++++++------ mantle/kola/tests/isula/isula.go | 4 ++-- mantle/kola/tests/ostree/basic.go | 20 ++++++++++---------- mantle/kola/tests/ostree/unlock.go | 4 ++++ mantle/kola/tests/podman/podman.go | 2 +- mantle/kola/tests/rpmostree/deployments.go | 4 +++- mantle/kola/tests/rpmostree/rebase.go | 2 ++ mantle/util/distros.go | 6 +++--- 8 files changed, 31 insertions(+), 23 deletions(-) diff --git a/mantle/kola/tests/coretest/core.go b/mantle/kola/tests/coretest/core.go index d02ea0ba..b2cc10da 100644 --- a/mantle/kola/tests/coretest/core.go +++ b/mantle/kola/tests/coretest/core.go @@ -102,34 +102,34 @@ func TestPortSsh() error { func TestDockerEcho() error { //t.Parallel() util.RunCmdTimeout(DockerTimeout, "sudo", "systemctl", "start", "docker") - return util.RunCmdTimeout(DockerTimeout, "sudo", "docker", "run", "docker.io/busybox", "echo") + return util.RunCmdTimeout(DockerTimeout, "sudo", "docker", "run", "atomhub.openatom.cn/library/busybox:latest", "echo") } func TestDockerPing() error { //t.Parallel() util.RunCmdTimeout(DockerTimeout, "sudo", "systemctl", "start", "docker") - return util.RunCmdTimeout(DockerTimeout, "sudo", "docker", "run", "docker.io/busybox", "ping", "-c4", "baidu.com") + return util.RunCmdTimeout(DockerTimeout, "sudo", "docker", "run", "atomhub.openatom.cn/library/busybox:latest", "ping", "-c4", "baidu.com") } func TestDockerWgetHead() error { //t.Parallel() util.RunCmdTimeout(DockerTimeout, "sudo", "systemctl", "start", "docker") - return util.RunCmdTimeout(DockerTimeout, "sudo", "docker", "run", "docker.io/busybox", "wget", "--spider", "https://nestos.org.cn/kola/hotspot.txt") + return util.RunCmdTimeout(DockerTimeout, "sudo", "docker", "run", "atomhub.openatom.cn/library/busybox:latest", "wget", "--spider", "https://nestos.org.cn/kola/hotspot.txt") } func TestPodmanEcho() error { //t.Parallel() - return util.RunCmdTimeout(DockerTimeout, "podman", "run", "docker.io/busybox", "echo") + return util.RunCmdTimeout(DockerTimeout, "podman", "run", "atomhub.openatom.cn/library/busybox:latest", "echo") } func TestPodmanPing() error { //t.Parallel() - return util.RunCmdTimeout(DockerTimeout, "podman", "run", "docker.io/busybox", "ping", "-c4", "baidu.com") + return util.RunCmdTimeout(DockerTimeout, "podman", "run", "atomhub.openatom.cn/library/busybox:latest", "ping", "-c4", "baidu.com") } func TestPodmanWgetHead() error { //t.Parallel() - return util.RunCmdTimeout(DockerTimeout, "podman", "run", "docker.io/busybox", "wget", "--spider", "https://nestos.org.cn/kola/hotspot.txt") + return util.RunCmdTimeout(DockerTimeout, "podman", "run", "atomhub.openatom.cn/library/busybox:latest", "wget", "--spider", "https://nestos.org.cn/kola/hotspot.txt") } // This execs gdbus, because we need to change uses to test perms. diff --git a/mantle/kola/tests/isula/isula.go b/mantle/kola/tests/isula/isula.go index 201a8cc0..92a25b89 100644 --- a/mantle/kola/tests/isula/isula.go +++ b/mantle/kola/tests/isula/isula.go @@ -127,7 +127,7 @@ func isulaWorkflow(c cluster.TestCluster) { // Test: Run container c.Run("run", func(c cluster.TestCluster) { - _, err := c.SSH(m, "sudo isula run -itd --name busybox docker.io/busybox") + _, err := c.SSH(m, "sudo isula run -itd --name busybox atomhub.openatom.cn/library/busybox:latest") if err != nil { c.Fatal(err) } @@ -191,7 +191,7 @@ func isulaWorkflow(c cluster.TestCluster) { // Test: Delete image c.Run("delete", func(c cluster.TestCluster) { - _, err := c.SSH(m, "sudo isula rmi docker.io/busybox") + _, err := c.SSH(m, "sudo isula rmi atomhub.openatom.cn/library/busybox:latest") if err != nil { c.Fatal(err) } diff --git a/mantle/kola/tests/ostree/basic.go b/mantle/kola/tests/ostree/basic.go index ce9682b3..53a02e0d 100644 --- a/mantle/kola/tests/ostree/basic.go +++ b/mantle/kola/tests/ostree/basic.go @@ -57,7 +57,7 @@ type ostreeAdminStatus struct { // getOstreeRemotes returns the current number of ostree remotes on a machine func getOstreeRemotes(c cluster.TestCluster, m platform.Machine) (int, []string) { - remoteListOut := string(c.MustSSH(m, "ostree remote list")) + remoteListOut := string(c.MustSSH(m, "sudo ostree remote list")) numRemotes := 0 // If we get anything other than an empty string calculate the results // NOTE: This is needed as splitting "" ends up providing a count of 1 @@ -74,7 +74,7 @@ func getOstreeRemotes(c cluster.TestCluster, m platform.Machine) (int, []string) func getOstreeAdminStatus(c cluster.TestCluster, m platform.Machine) (ostreeAdminStatus, error) { oaStatus := ostreeAdminStatus{} - oasOutput, err := c.SSH(m, "ostree admin status") + oasOutput, err := c.SSH(m, "sudo ostree admin status") if err != nil { return oaStatus, fmt.Errorf(`Could not get "ostree admin status": %v`, err) } @@ -149,12 +149,12 @@ func ostreeBasicTest(c cluster.TestCluster) { // the checksum now c.RunLogged("rev-parse", func(c cluster.TestCluster) { // check the output of `ostree rev-parse` - c.AssertCmdOutputContains(m, ("ostree rev-parse " + oas.Origin), oas.Checksum) + c.AssertCmdOutputContains(m, ("sudo ostree rev-parse " + oas.Origin), oas.Checksum) }) // verify the output of 'ostree show' c.RunLogged("show", func(c cluster.TestCluster) { - oShowOut := c.MustSSH(m, ("ostree show " + oas.Checksum)) + oShowOut := c.MustSSH(m, ("sudo ostree show " + oas.Checksum)) oShowOutSplit := strings.Split(string(oShowOut), "\n") // we need at least the first 4 lines (commit, ContentChecksum, Date, Version) // to proceed safely @@ -205,7 +205,7 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote list` c.Run("list", func(c cluster.TestCluster) { - osRemoteListOut := c.MustSSH(m, "ostree remote list -u") + osRemoteListOut := c.MustSSH(m, "sudo ostree remote list -u") osRemoteListSplit := strings.Split(string(osRemoteListOut), "\n") // should have original remote + newly added remote @@ -230,12 +230,12 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote show-url` c.Run("show-url", func(c cluster.TestCluster) { - c.AssertCmdOutputContains(m, ("ostree remote show-url " + remoteName), remoteUrl) + c.AssertCmdOutputContains(m, ("sudo ostree remote show-url " + remoteName), remoteUrl) }) // verify `ostree remote refs` c.Run("refs", func(c cluster.TestCluster) { - osRemoteRefsOut := c.MustSSH(m, ("ostree remote refs " + remoteName)) + osRemoteRefsOut := c.MustSSH(m, ("sudo ostree remote refs " + remoteName)) if len(strings.Split(string(osRemoteRefsOut), "\n")) < 1 { c.Fatalf(`Did not receive expected amount of refs from remote: %v`, string(osRemoteRefsOut)) } @@ -243,14 +243,14 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote summary` c.Run("summary", func(c cluster.TestCluster) { - remoteRefsOut := c.MustSSH(m, ("ostree remote refs " + remoteName)) + remoteRefsOut := c.MustSSH(m, ("sudo ostree remote refs " + remoteName)) remoteRefsOutSplit := strings.Split(string(remoteRefsOut), "\n") remoteRefsCount := len(remoteRefsOutSplit) if remoteRefsCount < 1 { c.Fatalf(`Did not find any refs on ostree remote: %q`, string(remoteRefsOut)) } - osRemoteSummaryOut := c.MustSSH(m, ("ostree remote summary " + remoteName)) + osRemoteSummaryOut := c.MustSSH(m, ("sudo ostree remote summary " + remoteName)) if len(strings.Split(string(osRemoteSummaryOut), "\n")) < 1 { c.Fatalf(`Did not receive expected summary content from remote: %v`, string(osRemoteSummaryOut)) } @@ -286,7 +286,7 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote delete` c.Run("delete", func(c cluster.TestCluster) { - preRemotesOut := c.MustSSH(m, "ostree remote list") + preRemotesOut := c.MustSSH(m, "sudo ostree remote list") preNumRemotes := len(strings.Split(string(preRemotesOut), "\n")) if preNumRemotes < 1 { diff --git a/mantle/kola/tests/ostree/unlock.go b/mantle/kola/tests/ostree/unlock.go index 126239fb..5d9fe8bf 100644 --- a/mantle/kola/tests/ostree/unlock.go +++ b/mantle/kola/tests/ostree/unlock.go @@ -32,6 +32,8 @@ func init() { Flags: []register.Flag{register.RequiresInternetAccess}, // need network to pull RPM FailFast: true, Tags: []string{"ostree"}, + // remove this testcase for iso,becase ro mount 'error: Remounting /sysroot read-write: Permission denied' + ExcludePlatforms: []string{"qemu-iso"}, }) register.RegisterTest(®ister.Test{ Run: ostreeHotfixTest, @@ -40,6 +42,8 @@ func init() { Name: "ostree.hotfix", FailFast: true, Tags: []string{"ostree"}, + // remove this testcase for iso,becase ro mount 'error: Remounting /sysroot read-write: Permission denied' + ExcludePlatforms: []string{"qemu-iso"}, // enable debugging for https://github.com/coreos/fedora-coreos-tracker/issues/942 // we can drop it once we resolved it UserData: conf.Butane(` diff --git a/mantle/kola/tests/podman/podman.go b/mantle/kola/tests/podman/podman.go index da34b180..1e0449ee 100644 --- a/mantle/kola/tests/podman/podman.go +++ b/mantle/kola/tests/podman/podman.go @@ -129,7 +129,7 @@ func podmanWorkflow(c cluster.TestCluster) { m := c.Machines()[0] // Test: Verify container can run with volume mount and port forwarding - image := "docker.nju.edu.cn/library/nginx" + image := "atomhub.openatom.cn/library/nginx" container_name := "nginx" wwwRoot := "/usr/share/nginx/html" var id string diff --git a/mantle/kola/tests/rpmostree/deployments.go b/mantle/kola/tests/rpmostree/deployments.go index dce8d96e..a0ad130b 100644 --- a/mantle/kola/tests/rpmostree/deployments.go +++ b/mantle/kola/tests/rpmostree/deployments.go @@ -32,6 +32,8 @@ func init() { Name: "rpmostree.upgrade-rollback", FailFast: true, Tags: []string{"rpm-ostree", "upgrade"}, + // remove this testcase for iso,becase ro mount 'error: Remounting /sysroot read-write: Permission denied' + ExcludePlatforms: []string{"qemu-iso"}, }) register.RegisterTest(®ister.Test{ Run: rpmOstreeInstallUninstall, @@ -201,7 +203,7 @@ func rpmOstreeInstallUninstall(c cluster.TestCluster) { m := c.Machines()[0] - _, err := c.SSH(m, `sudo bash -c 'cd ${HOME} && curl -O http://www.nestos.org.cn/kola/aht-dummy-1.0-1.noarch.rpm'`) + _, err := c.SSH(m, `bash -c 'cd ${HOME} && curl -L -O https://www.nestos.org.cn/kola/aht-dummy-1.0-1.noarch.rpm'`) if err != nil { c.Fatal(err) } diff --git a/mantle/kola/tests/rpmostree/rebase.go b/mantle/kola/tests/rpmostree/rebase.go index 3d9eaaf2..66cae349 100644 --- a/mantle/kola/tests/rpmostree/rebase.go +++ b/mantle/kola/tests/rpmostree/rebase.go @@ -14,6 +14,8 @@ func init() { FailFast: true, Tags: []string{"rpm-ostree", "upgrade"}, Flags: []register.Flag{register.RequiresInternetAccess}, + // remove this testcase for iso,becase ro mount 'error: Remounting /sysroot read-write: Permission denied' + ExcludePlatforms: []string{"qemu-iso"}, }) } diff --git a/mantle/util/distros.go b/mantle/util/distros.go index 8ddf800f..6e3744f1 100644 --- a/mantle/util/distros.go +++ b/mantle/util/distros.go @@ -32,8 +32,8 @@ func TargetDistroFromName(artifact string) string { if strings.HasPrefix(basename, "nestos-") { return "nestos" } - // For now, just assume fcos - return "fcos" + // For now, just assume nestos + return "nestos" } // TargetDistro returns the distribution of a cosa build @@ -45,7 +45,7 @@ func TargetDistro(build *builds.Build) (string, error) { return "rhcos", nil case "fedora-coreos": return "fcos", nil - case "nestos": + case "nestos", "NestOS-For-Container": return "nestos", nil default: return "", fmt.Errorf("Unknown distribution: %s", build.Name) -- Gitee