mirror of
https://github.com/goreleaser/nfpm
synced 2024-06-03 11:46:28 +02:00
test: acceptance tests for debian i386
This commit is contained in:
parent
9f7e12ad8f
commit
b4d00589a1
|
@ -3,9 +3,19 @@ package acceptance
|
|||
import "testing"
|
||||
|
||||
func TestSimpleDeb(t *testing.T) {
|
||||
accept(t, "simple_deb", "simple.yaml", "deb", "deb.dockerfile")
|
||||
t.Run("amd64", func(t *testing.T) {
|
||||
accept(t, "simple_deb", "simple.yaml", "deb", "deb.dockerfile")
|
||||
})
|
||||
t.Run("i386", func(t *testing.T) {
|
||||
accept(t, "simple_deb_386", "simple.386.yaml", "deb", "deb.386.dockerfile")
|
||||
})
|
||||
}
|
||||
|
||||
func TestComplexDeb(t *testing.T) {
|
||||
accept(t, "complex_deb", "complex.yaml", "deb", "deb.dockerfile")
|
||||
t.Run("amd64", func(t *testing.T) {
|
||||
accept(t, "complex_deb", "complex.yaml", "deb", "deb.dockerfile")
|
||||
})
|
||||
t.Run("i386", func(t *testing.T) {
|
||||
accept(t, "complex_deb_386", "complex.386.yaml", "deb", "deb.dockerfile")
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
name: "foo"
|
||||
arch: "386"
|
||||
platform: "linux"
|
||||
version: "v1.2.3"
|
||||
maintainer: "Foo Bar"
|
||||
depends:
|
||||
- bash
|
||||
provides:
|
||||
- fake
|
||||
replaces:
|
||||
- foo
|
||||
suggests:
|
||||
- zsh
|
||||
description: |
|
||||
Foo bar
|
||||
Multiple lines
|
||||
vendor: "foobar"
|
||||
homepage: "https://foobar.org"
|
||||
license: "MIT"
|
||||
files:
|
||||
../testdata/fake: "/usr/local/bin/fake"
|
||||
config_files:
|
||||
../testdata/whatever.conf: "/etc/foo/whatever.conf"
|
|
@ -0,0 +1,10 @@
|
|||
FROM i386/ubuntu
|
||||
ARG package
|
||||
COPY ${package} /tmp/foo.deb
|
||||
RUN dpkg -i /tmp/foo.deb && \
|
||||
test -e /usr/local/bin/fake && \
|
||||
test -f /etc/foo/whatever.conf && \
|
||||
echo wat >> /etc/foo/whatever.conf && \
|
||||
dpkg -r foo && \
|
||||
test -f /etc/foo/whatever.conf && \
|
||||
test ! -f /usr/local/bin/fake
|
|
@ -0,0 +1,15 @@
|
|||
name: "foo"
|
||||
arch: "386"
|
||||
platform: "linux"
|
||||
version: "v1.2.3"
|
||||
maintainer: "Foo Bar"
|
||||
description: |
|
||||
Foo bar
|
||||
Multiple lines
|
||||
vendor: "foobar"
|
||||
homepage: "https://foobar.org"
|
||||
license: "MIT"
|
||||
files:
|
||||
../testdata/fake: "/usr/local/bin/fake"
|
||||
config_files:
|
||||
../testdata/whatever.conf: "/etc/foo/whatever.conf"
|
|
@ -41,7 +41,6 @@ type Deb struct{}
|
|||
|
||||
// Package writes a new deb package to the given writer using the given info
|
||||
func (*Deb) Package(info nfpm.Info, deb io.Writer) (err error) {
|
||||
// TODO: add acceptance tests for this
|
||||
arch, ok := goarchToDebian[info.Arch]
|
||||
if ok {
|
||||
info.Arch = arch
|
||||
|
|
Loading…
Reference in New Issue