Skip to content

Commit

Permalink
chore: using apt-get instead of apt
Browse files Browse the repository at this point in the history
apt is not suited for scripting, we must use apt-get instead.
  • Loading branch information
ricardomaraschini committed Oct 4, 2023
1 parent 59acad4 commit 5ef4cd8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions e2e/embed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
26 changes: 13 additions & 13 deletions e2e/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions e2e/scripts/addons-only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions e2e/scripts/embed-and-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions e2e/scripts/install-with-disabled-addons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ef4cd8

Please sign in to comment.