Use correct url for non-x8664 platforms

This commit is contained in:
Rob Parker
2018-06-04 13:17:08 +01:00
committed by Arthur Barr
parent f8b500e0a1
commit 0f4e79c0a6

View File

@@ -23,6 +23,7 @@ import (
"fmt" "fmt"
"path/filepath" "path/filepath"
"regexp" "regexp"
"runtime"
"strconv" "strconv"
"strings" "strings"
"testing" "testing"
@@ -117,7 +118,13 @@ func TestSecurityVulnerabilities(t *testing.T) {
t.Skip("Skipping test because container is not Ubuntu-based") t.Skip("Skipping test because container is not Ubuntu-based")
} }
// Override the entrypoint to make "apt" only receive security updates, then check for updates // Override the entrypoint to make "apt" only receive security updates, then check for updates
rc, log := runContainerOneShot(t, cli, "bash", "-c", "source /etc/os-release && echo \"deb http://security.ubuntu.com/ubuntu/ ${VERSION_CODENAME}-security main restricted\" > /etc/apt/sources.list && apt-get update 2>&1 >/dev/null && apt-get --simulate -qq upgrade") var url string
if runtime.GOARCH == "amd64" {
url = "http://security.ubuntu.com/ubuntu/"
} else {
url = "http://ports.ubuntu.com/ubuntu-ports/"
}
rc, log := runContainerOneShot(t, cli, "bash", "-c", "source /etc/os-release && echo \"deb "+url+" ${VERSION_CODENAME}-security main restricted\" > /etc/apt/sources.list && apt-get update 2>&1 >/dev/null && apt-get --simulate -qq upgrade")
if rc != 0 { if rc != 0 {
t.Fatalf("Expected success, got %v", rc) t.Fatalf("Expected success, got %v", rc)
} }