Skip to content

Commit

Permalink
ci: update acceptance tests to debian:trixie, remove dpkg-sig from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Nov 10, 2024
1 parent 08822ca commit 666ef77
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 49 deletions.
41 changes: 18 additions & 23 deletions acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,30 +318,25 @@ func TestRPMSign(t *testing.T) {
func TestDebSign(t *testing.T) {
t.Parallel()
for _, arch := range formatArchs["deb"] {
for _, sigtype := range []string{"dpkg-sig", "debsign"} {
func(t *testing.T, testSigtype, testArch string) {
t.Run(fmt.Sprintf("deb/%s/%s", testArch, testSigtype), func(t *testing.T) {
t.Parallel()
target := "signed"
if testSigtype == "dpkg-sig" {
target = "dpkg-signed"
}
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
t.Skip("ppc64le arch not supported in pipeline")
}
accept(t, acceptParms{
Name: fmt.Sprintf("%s_sign_%s", testSigtype, testArch),
Conf: fmt.Sprintf("deb.%s.sign.yaml", testSigtype),
Format: "deb",
Docker: dockerParams{
File: "deb.dockerfile",
Target: target,
Arch: testArch,
},
})
func(t *testing.T, testArch string) {
t.Run(fmt.Sprintf("deb/%s", testArch), func(t *testing.T) {
t.Parallel()
target := "signed"
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
t.Skip("ppc64le arch not supported in pipeline")
}
accept(t, acceptParms{
Name: "debsign_sign_" + testArch,
Conf: "deb.debsign.sign.yaml",
Format: "deb",
Docker: dockerParams{
File: "deb.dockerfile",
Target: target,
Arch: testArch,
},
})
}(t, sigtype, arch)
}
})
}(t, arch)
}
}

Expand Down
4 changes: 2 additions & 2 deletions nfpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ type Deb struct {

type DebSignature struct {
PackageSignature `yaml:",inline" json:",inline"`
// debsign, or dpkg-sig (defaults to debsign)
Method string `yaml:"method,omitempty" json:"method,omitempty" jsonschema:"title=method role,enum=debsign,enum=dpkg-sig,default=debsign"`
// Only debsign still supported
Method string `yaml:"method,omitempty" json:"method,omitempty" jsonschema:"title=method role,enum=debsign,default=debsign"`
// origin, maint or archive (defaults to origin)
Type string `yaml:"type,omitempty" json:"type,omitempty" jsonschema:"title=signer role,enum=origin,enum=maint,enum=archive,default=origin"`
Signer string `yaml:"signer,omitempty" json:"signer,omitempty" jsonschema:"title=signer"`
Expand Down
10 changes: 1 addition & 9 deletions testdata/acceptance/deb.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:11 AS test_base
FROM debian:trixie AS test_base
ARG package
RUN echo "${package}"
COPY ${package} /tmp/foo.deb
Expand Down Expand Up @@ -85,14 +85,6 @@ RUN debsig-verify /tmp/foo.deb | grep "debsig: Verified package from 'Test packa
RUN echo "" > /etc/dpkg/dpkg.cfg
RUN dpkg -i /tmp/foo.deb

# ---- signed dpkg-sig test ----
FROM test_base AS dpkg-signed
RUN apt update -y
RUN apt install -y dpkg-sig
# TODO: we should properly check the signature here, not sure how to do so.
RUN dpkg-sig --verify /tmp/foo.deb | grep "UNKNOWNSIG _gpgbuilder 15BD80B3"
RUN dpkg -i /tmp/foo.deb

# ---- overrides test ----
FROM min AS overrides
RUN test -e /usr/bin/fake
Expand Down
15 changes: 0 additions & 15 deletions testdata/acceptance/deb.dpkg-sig.sign.yaml

This file was deleted.

1 change: 1 addition & 0 deletions www/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ deb:
signature:
# Signature method, either "dpkg-sig" or "debsign".
# Defaults to "debsign"
# "dpkg-sig" is not supported in newer Debian versions.
method: dpkg-sig

# PGP secret key (can also be ASCII-armored). The passphrase is taken
Expand Down

0 comments on commit 666ef77

Please sign in to comment.