Use correct url for non-x8664 platforms
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -117,7 +118,13 @@ func TestSecurityVulnerabilities(t *testing.T) {
|
||||
t.Skip("Skipping test because container is not Ubuntu-based")
|
||||
}
|
||||
// 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 {
|
||||
t.Fatalf("Expected success, got %v", rc)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user