From cefa180b931efedd98252d3f2ba18246d7ad5920 Mon Sep 17 00:00:00 2001 From: wangyueliang Date: Tue, 16 Jul 2024 18:25:49 +0800 Subject: [PATCH] Resolve exceptions caused by merge dev branch --- cmd/coreos-assembler.go | 4 +- mantle/kola/tests/ignition/resource.go | 138 ------------------------- mantle/kola/tests/ostree/basic.go | 14 +-- src/deps.txt | 3 +- src/vmdeps.txt | 3 +- 5 files changed, 11 insertions(+), 151 deletions(-) diff --git a/cmd/coreos-assembler.go b/cmd/coreos-assembler.go index 73f60ee7..69d2a264 100644 --- a/cmd/coreos-assembler.go +++ b/cmd/coreos-assembler.go @@ -13,7 +13,7 @@ import ( // commands we'd expect to use in the local dev path var buildCommands = []string{"init", "fetch", "build", "run", "prune", "clean", "list"} -var advancedBuildCommands = []string{"push-container", "upload-oscontainer", "buildextend-extensions"} +var advancedBuildCommands = []string{"push-container", "upload-oscontainer"} var buildextendCommands = []string{"extensions", "extensions-container", "legacy-oscontainer", "live", "metal", "metal4k", "openstack", "qemu", "secex"} var utilityCommands = []string{"compress", "copy-container", "kola", "push-container-manifest", "remote-build-container", "remote-prune", "remote-session", "tag", "virt-install"} @@ -61,7 +61,7 @@ func printUsage() { printCommands("Other commands", otherCommands) fmt.Printf("\nNotice:\n") - fmt.Printf(" For bug reports, please submit an issue at [nestos-assembler](https://gitee.com/openeuler/nestos-assembler).") + fmt.Printf(" For bug reports, please submit an issue at [nestos-assembler](https://gitee.com/openeuler/nestos-assembler).\n") fmt.Printf(" This software is a fork of [coreos-assembler](https://github.com/coreos/coreos-assembler), licensed under the [Apache-2.0 License](https://www.apache.org/licenses/LICENSE-2.0).\n") } diff --git a/mantle/kola/tests/ignition/resource.go b/mantle/kola/tests/ignition/resource.go index 7f3c342b..903cd437 100644 --- a/mantle/kola/tests/ignition/resource.go +++ b/mantle/kola/tests/ignition/resource.go @@ -76,102 +76,6 @@ func init() { ExcludePlatforms: []string{"qemu"}, Timeout: 20 * time.Minute, }) - register.RegisterTest(®ister.Test{ - Name: "nestos.ignition.resource.remote", - Run: resourceRemote, - ClusterSize: 1, - Flags: []register.Flag{register.RequiresInternetAccess}, - Tags: []string{"ignition"}, - // https://github.com/coreos/bugs/issues/2205 for DO - ExcludePlatforms: []string{"do"}, - UserData: conf.Ignition(`{ - "ignition": { - "version": "3.0.0" - }, - "storage": { - "files": [ - { - "path": "/var/resource/http", - "contents": { - "source": "http://nestos.org.cn/kola/anonymous" - }, - "mode": 420 - }, - { - "path": "/var/resource/https", - "contents": { - "source": "https://nestos.org.cn/kola/anonymous" - }, - "mode": 420 - } - ] - } - }`), - }) - register.RegisterTest(®ister.Test{ - Name: "nestos.ignition.resource.s3", - Run: resourceS3, - ClusterSize: 1, - Platforms: []string{"aws"}, - Tags: []string{"ignition"}, - UserData: conf.Ignition(`{ - "ignition": { - "version": "3.0.0", - "config": { - "merge": [{ - "source": "s3://rh-kola-fixtures/resources/authenticated-var-v3.ign" - }] - } - }, - "storage": { - "files": [ - { - "path": "/var/resource/s3-auth", - "contents": { - "source": "s3://rh-kola-fixtures/resources/authenticated" - }, - "mode": 420 - } - ] - } - }`), - }) - // TODO: once Ignition supports this on all channels/distros - // this test should be rolled into coreos.ignition.resources.remote - // Test specifically for versioned s3 objects - register.RegisterTest(®ister.Test{ - Name: "nestos.ignition.resource.s3.versioned", - Run: resourceS3Versioned, - ClusterSize: 1, - Flags: []register.Flag{register.RequiresInternetAccess}, - Tags: []string{"ignition"}, - // https://github.com/coreos/bugs/issues/2205 for DO - ExcludePlatforms: []string{"do"}, - UserData: conf.Ignition(`{ - "ignition": { - "version": "3.0.0" - }, - "storage": { - "files": [ - { - "path": "/var/resource/original", - "contents": { - "source": "https://rh-kola-fixtures.s3.amazonaws.com/resources/versioned?versionId=Ym98GTx0npVaJznSAd0I1eUjFoZMP8Zo" - }, - "mode": 420 - }, - { - "path": "/var/resource/latest", - "contents": { - "source": "https://rh-kola-fixtures.s3.amazonaws.com/resources/versioned" - }, - "mode": 420 - } - ] - } - }`), - Distros: []string{"rhcos"}, - }) } func resourceLocal(c cluster.TestCluster) { @@ -198,48 +102,6 @@ func resourceLocal(c cluster.TestCluster) { }) } -func resourceRemote(c cluster.TestCluster) { - m := c.Machines()[0] - - checkResources(c, m, map[string]string{ - "http": "kola-anonymous", - "https": "kola-anonymous", - }) -} - -func resourceS3(c cluster.TestCluster) { - m := c.Machines()[0] - - checkResources(c, m, map[string]string{ - // object accessible by any authenticated S3 user, such as - // the IAM role associated with the instance - "s3-auth": "kola-authenticated", - // object created by configuration accessible by any authenticated - // S3 user, such as the IAM role associated with the instance - "s3-config": "kola-config", - }) - - // verify that the objects are inaccessible anonymously - for _, objectName := range []string{"authenticated", "authenticated.ign"} { - _, _, err := m.SSH("curl -sf https://rh-kola-fixtures.s3.amazonaws.com/resources/" + objectName) - if err == nil { - c.Fatal("anonymously fetching authenticated resource should have failed, but did not") - } - } - - // ...but that the anonymous object is accessible - c.RunCmdSync(m, "curl -sf https://rh-kola-fixtures.s3.amazonaws.com/resources/anonymous") -} - -func resourceS3Versioned(c cluster.TestCluster) { - m := c.Machines()[0] - - checkResources(c, m, map[string]string{ - "original": "original", - "latest": "updated", - }) -} - func checkResources(c cluster.TestCluster, m platform.Machine, resources map[string]string) { for filename, expectedContents := range resources { contents := c.MustSSH(m, fmt.Sprintf("sudo cat /var/resource/%s", filename)) diff --git a/mantle/kola/tests/ostree/basic.go b/mantle/kola/tests/ostree/basic.go index a13c107a..22aa0884 100644 --- a/mantle/kola/tests/ostree/basic.go +++ b/mantle/kola/tests/ostree/basic.go @@ -37,7 +37,7 @@ func init() { // 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, "sudo ostree remote list")) + remoteListOut := string(c.MustSSH(m, "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 @@ -70,7 +70,7 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote list` c.Run("list", func(c cluster.TestCluster) { - osRemoteListOut := c.MustSSH(m, "sudo ostree remote list -u") + osRemoteListOut := c.MustSSH(m, "ostree remote list -u") osRemoteListSplit := strings.Split(string(osRemoteListOut), "\n") // should have original remote + newly added remote @@ -95,12 +95,12 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote show-url` c.Run("show-url", func(c cluster.TestCluster) { - c.AssertCmdOutputContains(m, ("sudo ostree remote show-url " + remoteName), remoteUrl) + c.AssertCmdOutputContains(m, ("ostree remote show-url " + remoteName), remoteUrl) }) // verify `ostree remote refs` c.Run("refs", func(c cluster.TestCluster) { - osRemoteRefsOut := c.MustSSH(m, ("sudo ostree remote refs " + remoteName)) + osRemoteRefsOut := c.MustSSH(m, ("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)) } @@ -108,14 +108,14 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote summary` c.Run("summary", func(c cluster.TestCluster) { - remoteRefsOut := c.MustSSH(m, ("sudo ostree remote refs " + remoteName)) + remoteRefsOut := c.MustSSH(m, ("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, ("sudo ostree remote summary " + remoteName)) + osRemoteSummaryOut := c.MustSSH(m, ("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)) } @@ -151,7 +151,7 @@ func ostreeRemoteTest(c cluster.TestCluster) { // verify `ostree remote delete` c.Run("delete", func(c cluster.TestCluster) { - preRemotesOut := c.MustSSH(m, "sudo ostree remote list") + preRemotesOut := c.MustSSH(m, "ostree remote list") preNumRemotes := len(strings.Split(string(preRemotesOut), "\n")) if preNumRemotes < 1 { diff --git a/src/deps.txt b/src/deps.txt index 6c563eda..23befa32 100644 --- a/src/deps.txt +++ b/src/deps.txt @@ -37,8 +37,7 @@ rsync python3-gobject-base # To support recursive containerization and manipulating images -# podman buildah skopeo -podman skopeo +podman buildah skopeo # Miscellaneous tools jq diff --git a/src/vmdeps.txt b/src/vmdeps.txt index 61063fe0..37fb0b3e 100644 --- a/src/vmdeps.txt +++ b/src/vmdeps.txt @@ -18,8 +18,7 @@ dhcp-client iproute selinux-policy selinux-policy-targeted policycoreutils # coreos-assembler -# python3 python3-gobject-base buildah podman skopeo iptables iptables-libs -python3 python3-gobject-base podman skopeo iptables iptables-libs +python3 python3-gobject-base buildah podman skopeo iptables iptables-libs # legacy-oscontainer python3-pyyaml python3-botocore python3-flufl.lock python3-tenacity -- Gitee