Skip to content

Commit

Permalink
Merge pull request GoogleContainerTools#808 from GoogleContainerTools…
Browse files Browse the repository at this point in the history
…/fix-inrelease-url

Fix debian security InRelease url
  • Loading branch information
loosebazooka authored Aug 30, 2021
2 parents ff47e96 + bf05a5a commit 6b96c38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gcscache/internal/dpkg/package_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func security(release, arch string) PackageIndex {
Release: release,
Arch: arch,
PackagesXZ: fmt.Sprintf("https://security.debian.org/dists/%s/updates/main/binary-%s/Packages.xz", release, arch),
InRelease: fmt.Sprintf("https://security.debian.org/dists/%s/InRelease", release),
InRelease: fmt.Sprintf("https://security.debian.org/dists/%s/updates/InRelease", release),
PoolParent: "https://security.debian.org/debian-security/",
}
}
Expand Down
14 changes: 12 additions & 2 deletions gcscache/internal/dpkg/package_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestStructCreation(t *testing.T) {
Channel: "security",
Release: "testRel",
Arch: "testArch",
InRelease: "https://security.debian.org/dists/testRel/InRelease",
InRelease: "https://security.debian.org/dists/testRel/updates/InRelease",
PackagesXZ: "https://security.debian.org/dists/testRel/updates/main/binary-testArch/Packages.xz",
PoolParent: "https://security.debian.org/debian-security/",
},
Expand All @@ -67,7 +67,7 @@ func TestStructCreation(t *testing.T) {
}
}

func TestPackageIndexesExist(t *testing.T) {
func TestRemotePackageInfoExists(t *testing.T) {
ps := PackageIndexes()

for _, pi := range ps {
Expand All @@ -80,5 +80,15 @@ func TestPackageIndexesExist(t *testing.T) {
t.Fatalf("Could not verify existence of remote packages index: %q", pi.PackagesXZ)
}
})

t.Run(pi.InRelease, func(t *testing.T) {
resp, err := http.Head(pi.InRelease)
if err != nil {
t.Fatalf("Could not verify existence of remote InRelease: %q", pi.InRelease)
}
if resp.StatusCode != http.StatusOK {
t.Fatalf("Could not verify existence of remote InRelease: %q", pi.InRelease)
}
})
}
}

0 comments on commit 6b96c38

Please sign in to comment.