| From 4ed8c167d5cdf9f3c42ebe042444acf322cc7520 Mon Sep 17 00:00:00 2001 |
| From: Nandhini Rengaraj <nrengaraj@google.com> |
| Date: Mon, 22 May 2023 18:34:58 +0000 |
| Subject: [PATCH] Remove crio setup in test framework |
| |
| cri-tool integration e2e tests use crio CRI by default. This commit |
| removes the CRIO setup and start up steps and replaces the crio |
| endpoint with containerd. |
| |
| version_test.go looks for runtime name, updated to containerd |
| --- |
| test/e2e/version_test.go | 2 +- |
| test/framework/framework.go | 98 +++++++++++++++++++------------------ |
| 2 files changed, 51 insertions(+), 49 deletions(-) |
| |
| diff --git a/test/e2e/version_test.go b/test/e2e/version_test.go |
| index cc463af0..3f88829a 100644 |
| --- a/test/e2e/version_test.go |
| +++ b/test/e2e/version_test.go |
| @@ -27,7 +27,7 @@ var _ = t.Describe("version", func() { |
| endpoint, testDir, crio := t.StartCrio() |
| |
| // When |
| - t.CrictlExpectSuccessWithEndpoint(endpoint, "version", "RuntimeName: cri-o") |
| + t.CrictlExpectSuccessWithEndpoint(endpoint, "version", "RuntimeName: containerd") |
| |
| // Then |
| t.StopCrio(testDir, crio) |
| diff --git a/test/framework/framework.go b/test/framework/framework.go |
| index be074534..e0548c97 100644 |
| --- a/test/framework/framework.go |
| +++ b/test/framework/framework.go |
| @@ -141,10 +141,10 @@ func SetupCrio() string { |
| if _, err := os.Stat(tmpDir); errors.Is(err, os.ErrNotExist) { |
| logrus.Info("cloning and building CRI-O") |
| |
| - Expect(checkoutAndBuild(tmpDir, crioURL, crioVersion)).To(BeNil()) |
| + // Expect(checkoutAndBuild(tmpDir, crioURL, crioVersion)).To(BeNil()) |
| |
| - conmonTmp := filepath.Join(tmpDir, "conmon") |
| - checkoutAndBuild(conmonTmp, conmonURL, conmonVersion) |
| + // conmonTmp := filepath.Join(tmpDir, "conmon") |
| + // checkoutAndBuild(conmonTmp, conmonURL, conmonVersion) |
| } |
| |
| return tmpDir |
| @@ -170,49 +170,50 @@ func (t *TestFramework) StartCrio() (string, string, *Session) { |
| Expect(err).To(BeNil()) |
| |
| // Copy everything together |
| - lcmd("cp -R %s %s", filepath.Join(t.crioDir, "bin"), tmpDir).Wait() |
| - |
| - lcmd("cp %s %s", filepath.Join(t.crioDir, "test", "policy.json"), |
| - tmpDir).Wait() |
| - |
| - for _, d := range []string{ |
| - "cni-config", "root", "runroot", "log", "exits", "attach", |
| - } { |
| - Expect(os.MkdirAll(filepath.Join(tmpDir, d), 0755)).To(BeNil()) |
| - } |
| - |
| - lcmd("cp %s %s", filepath.Join(t.crioDir, "contrib", "cni", |
| - "10-crio-bridge.conf"), |
| - filepath.Join(tmpDir, "cni-config")).Wait() |
| - |
| - endpoint := filepath.Join(tmpDir, "crio.sock") |
| - |
| - session := cmd(tmpDir, "%s"+ |
| - " --config=%s"+ |
| - " --listen=%s"+ |
| - " --conmon=%s"+ |
| - " --container-exits-dir=%s"+ |
| - " --container-attach-socket-dir=%s"+ |
| - " --log-dir=%s"+ |
| - " --signature-policy=%s"+ |
| - " --cni-config-dir=%s"+ |
| - " --root=%s"+ |
| - " --runroot=%s"+ |
| - " --pinns-path=%s", |
| - filepath.Join(tmpDir, "bin", "crio"), |
| - filepath.Join(t.crioDir, "crio.conf"), |
| - endpoint, |
| - filepath.Join(t.crioDir, "conmon", "bin", "conmon"), |
| - filepath.Join(tmpDir, "exits"), |
| - filepath.Join(tmpDir, "attach"), |
| - filepath.Join(tmpDir, "log"), |
| - filepath.Join(tmpDir, "policy.json"), |
| - filepath.Join(tmpDir, "cni-config"), |
| - filepath.Join(tmpDir, "root"), |
| - filepath.Join(tmpDir, "runroot"), |
| - filepath.Join(tmpDir, "bin", "pinns"), |
| - ) |
| - |
| + // lcmd("cp -R %s %s", filepath.Join(t.crioDir, "bin"), tmpDir).Wait() |
| + |
| + // lcmd("cp %s %s", filepath.Join(t.crioDir, "test", "policy.json"), |
| + // tmpDir).Wait() |
| + |
| + // for _, d := range []string{ |
| + // "cni-config", "root", "runroot", "log", "exits", "attach", |
| + //} { |
| + // Expect(os.MkdirAll(filepath.Join(tmpDir, d), 0755)).To(BeNil()) |
| + //} |
| + |
| + //lcmd("cp %s %s", filepath.Join(t.crioDir, "contrib", "cni", |
| + // "10-crio-bridge.conf"), |
| + // filepath.Join(tmpDir, "cni-config")).Wait() |
| + |
| + endpoint := "/var/run/containerd/containerd.sock" |
| + |
| + //session := cmd(tmpDir, "%s"+ |
| + // " --config=%s"+ |
| + // " --listen=%s"+ |
| + // " --conmon=%s"+ |
| + // " --container-exits-dir=%s"+ |
| + // " --container-attach-socket-dir=%s"+ |
| + // " --log-dir=%s"+ |
| + // " --signature-policy=%s"+ |
| + // " --cni-config-dir=%s"+ |
| + // " --root=%s"+ |
| + // " --runroot=%s"+ |
| + // " --pinns-path=%s", |
| + // filepath.Join(tmpDir, "bin", "crio"), |
| + // filepath.Join(t.crioDir, "crio.conf"), |
| + // endpoint, |
| + // filepath.Join(t.crioDir, "conmon", "bin", "conmon"), |
| + // filepath.Join(tmpDir, "exits"), |
| + // filepath.Join(tmpDir, "attach"), |
| + // filepath.Join(tmpDir, "log"), |
| + // filepath.Join(tmpDir, "policy.json"), |
| + // filepath.Join(tmpDir, "cni-config"), |
| + // filepath.Join(tmpDir, "root"), |
| + // filepath.Join(tmpDir, "runroot"), |
| + // filepath.Join(tmpDir, "bin", "pinns"), |
| + //) |
| + |
| + var session *Session |
| endpoint = "unix://" + endpoint |
| |
| // Wait for the connection to be available |
| @@ -221,7 +222,7 @@ func (t *TestFramework) StartCrio() (string, string, *Session) { |
| if res.ExitCode() == 0 { |
| break |
| } |
| - logrus.Info("Waiting for CRI-O to become ready") |
| + logrus.Info("Waiting for Containerd to become ready") |
| time.Sleep(3 * time.Second) |
| } |
| return endpoint, tmpDir, session |
| @@ -229,5 +230,6 @@ func (t *TestFramework) StartCrio() (string, string, *Session) { |
| |
| // Stop the container runtime process |
| func (t *TestFramework) StopCrio(testDir string, session *Session) { |
| - Expect(session.Interrupt().Wait()).To(Exit(0)) |
| + logrus.Info("This doesn't stop anything") |
| +// Expect(session.Interrupt().Wait()).To(Exit(0)) |
| } |
| -- |
| 2.40.1.698.g37aff9b760-goog |
| |