From 5ef4cd87fa063b9984f05e2ec6a6cefcc0b356f5 Mon Sep 17 00:00:00 2001 From: Ricardo Maraschini Date: Wed, 4 Oct 2023 11:58:50 +0200 Subject: [PATCH] chore: using apt-get instead of apt apt is not suited for scripting, we must use apt-get instead. --- e2e/embed_test.go | 8 +++---- e2e/install_test.go | 26 ++++++++++----------- e2e/scripts/addons-only.sh | 4 ++-- e2e/scripts/embed-and-install.sh | 4 ++-- e2e/scripts/install-with-disabled-addons.sh | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/e2e/embed_test.go b/e2e/embed_test.go index d05a84bb0..b269b5ce6 100644 --- a/e2e/embed_test.go +++ b/e2e/embed_test.go @@ -19,8 +19,8 @@ func TestEmbedAndInstall(t *testing.T) { defer tc.Destroy() t.Log("installing ssh in node 0") commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, 0, commands); err != nil { t.Fatalf("fail to install ssh on node %s: %v", tc.Nodes[0], err) @@ -45,8 +45,8 @@ func TestEmbedAddonsOnly(t *testing.T) { defer tc.Destroy() t.Log("installing ssh in node 0") commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, 0, commands); err != nil { t.Fatalf("fail to install ssh on node %s: %v", tc.Nodes[0], err) diff --git a/e2e/install_test.go b/e2e/install_test.go index f82781403..5f08c8115 100644 --- a/e2e/install_test.go +++ b/e2e/install_test.go @@ -21,8 +21,8 @@ func TestTokenBasedMultiNodeInstallation(t *testing.T) { defer tc.Destroy() t.Log("installing ssh on node 0") commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, 0, commands); err != nil { t.Fatalf("fail to install ssh on node %s: %v", tc.Nodes[0], err) @@ -82,8 +82,8 @@ func TestSingleNodeInstallation(t *testing.T) { defer tc.Destroy() t.Log("installing ssh on node 0") commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, 0, commands); err != nil { t.Fatalf("fail to install ssh on node %s: %v", tc.Nodes[0], err) @@ -110,8 +110,8 @@ func TestMultiNodeInstallation(t *testing.T) { for i := range tc.Nodes { t.Logf("installing ssh on node %d", i) commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, i, commands); err != nil { t.Fatalf("fail to install ssh on node %d: %v", i, err) @@ -164,8 +164,8 @@ func TestSingleNodeInstallationDebian12(t *testing.T) { defer tc.Destroy() t.Log("installing ssh on node 0") commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, 0, commands); err != nil { t.Fatalf("fail to install ssh on node 0: %v", err) @@ -220,15 +220,15 @@ func TestMultiNodeInteractiveInstallation(t *testing.T) { for i := range tc.Nodes { t.Logf("installing ssh on node %d", i) commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, i, commands); err != nil { t.Fatalf("fail to install ssh on node %d: %v", i, err) } } t.Logf("installing expect on node 0") - line := []string{"apt", "install", "expect", "-y"} + line := []string{"apt-get", "install", "expect", "-y"} if _, _, err := RunCommandOnNode(t, tc, 0, line); err != nil { t.Fatalf("fail to install expect on node 0: %v", err) } @@ -257,8 +257,8 @@ func TestInstallWithDisabledAddons(t *testing.T) { defer tc.Destroy() t.Log("installing ssh in node 0") commands := [][]string{ - {"apt", "update", "-y"}, - {"apt", "install", "openssh-server", "-y"}, + {"apt-get", "update", "-y"}, + {"apt-get", "install", "openssh-server", "-y"}, } if err := RunCommandsOnNode(t, tc, 0, commands); err != nil { t.Fatalf("fail to install ssh on node %s: %v", tc.Nodes[0], err) diff --git a/e2e/scripts/addons-only.sh b/e2e/scripts/addons-only.sh index 60a32232d..101317cd0 100644 --- a/e2e/scripts/addons-only.sh +++ b/e2e/scripts/addons-only.sh @@ -21,8 +21,8 @@ wait_for_healthy_node() { } install_helm() { - apt update -y - if ! apt install -y curl ; then + apt-get update -y + if ! apt-get install -y curl ; then return 1 fi if ! curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 ; then diff --git a/e2e/scripts/embed-and-install.sh b/e2e/scripts/embed-and-install.sh index 092f42591..ac601c959 100644 --- a/e2e/scripts/embed-and-install.sh +++ b/e2e/scripts/embed-and-install.sh @@ -21,8 +21,8 @@ wait_for_healthy_node() { } install_helm() { - apt update -y - if ! apt install -y curl ; then + apt-get update -y + if ! apt-get install -y curl ; then return 1 fi if ! curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 ; then diff --git a/e2e/scripts/install-with-disabled-addons.sh b/e2e/scripts/install-with-disabled-addons.sh index a175f50af..e2267b8c1 100644 --- a/e2e/scripts/install-with-disabled-addons.sh +++ b/e2e/scripts/install-with-disabled-addons.sh @@ -18,8 +18,8 @@ wait_for_healthy_node() { } install_helm() { - apt update -y - if ! apt install -y curl ; then + apt-get update -y + if ! apt-get install -y curl ; then return 1 fi if ! curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 ; then