Skip to content

Commit

Permalink
Merge pull request #35 from ryancox/master
Browse files Browse the repository at this point in the history
add support for Alpine Linux
  • Loading branch information
aelsabbahy committed Jan 19, 2016
2 parents a18fce8 + b7b0ae8 commit 56508f0
Show file tree
Hide file tree
Showing 10 changed files with 418 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ The following tests have limitations.
Package:
* rpm
* deb
* Alpine apk

Service:
* systemd
* sysV init
* OpenRC init
* Upstart

## Installation
Expand Down Expand Up @@ -100,7 +102,7 @@ COMMANDS:
GLOBAL OPTIONS:
--gossfile, -g "./goss.json" Goss file to read from / write to [$GOSS_FILE]
--package Package type to use [rpm, deb]
--package Package type to use [rpm, deb, alpine]
--help, -h show help
--generate-bash-completion
--version, -v print the version
Expand Down
16 changes: 16 additions & 0 deletions integration-tests/Dockerfile_alpine3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM gliderlabs/alpine:3.3
MAINTAINER Ahmed

# install glibc since goss will need it
RUN touch /etc/network/interfaces && \
apk add --update ca-certificates device-mapper && \
wget https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/8/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk && \
wget https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/8/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk && \
apk add --allow-untrusted glibc-2.21-r2.apk glibc-bin-2.21-r2.apk && \
/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
rm -rf /var/cache/apk/*

# install apache2 and remove un-needed services
RUN apk update && apk add openrc apache2 bash && rc-update add apache2 && rm /etc/init.d/networking /etc/init.d/hwdrivers

16 changes: 16 additions & 0 deletions integration-tests/goss/alpine3/goss-aa-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"package": {
"apache2": {
"installed": true,
"versions": [
"2.4.17-r4"
]
}
},
"service": {
"apache2": {
"enabled": true,
"running": true
}
}
}
98 changes: 98 additions & 0 deletions integration-tests/goss/alpine3/goss-expected-q.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"file": {
"/etc/passwd": {
"exists": true,
"contains": []
},
"/tmp/goss/foobar": {
"exists": false,
"contains": []
}
},
"package": {
"apache2": {
"installed": true
},
"foobar": {
"installed": false
},
"vim-tiny": {
"installed": false
}
},
"addr": {
"tcp://google.com:22": {
"reachable": false,
"timeout": 500
},
"tcp://google.com:443": {
"reachable": true,
"timeout": 500
}
},
"port": {
"tcp6:80": {
"listening": true
},
"tcp:80": {
"listening": false
},
"tcp:9999": {
"listening": false
}
},
"service": {
"apache2": {
"enabled": true,
"running": true
},
"foobar": {
"enabled": false,
"running": false
}
},
"user": {
"foobar": {
"exists": false
},
"www-data": {
"exists": false
}
},
"group": {
"foobar": {
"exists": false
},
"www-data": {
"exists": true
}
},
"command": {
"apache2 -v": {
"exit-status": "127",
"stdout": [],
"stderr": [],
"timeout": 10000
},
"foobar": {
"exit-status": "127",
"stdout": [],
"stderr": [],
"timeout": 10000
}
},
"dns": {
"localhost": {
"resolveable": true,
"timeout": 500
}
},
"process": {
"apache2": {
"running": false
},
"foobar": {
"running": false
}
}
}
117 changes: 117 additions & 0 deletions integration-tests/goss/alpine3/goss-expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"file": {
"/etc/passwd": {
"exists": true,
"mode": "0644",
"owner": "root",
"group": "root",
"filetype": "file",
"contains": []
},
"/tmp/goss/foobar": {
"exists": false,
"contains": []
}
},
"package": {
"apache2": {
"installed": true,
"versions": [
"2.4.17-r4"
]
},
"foobar": {
"installed": false
},
"vim-tiny": {
"installed": false
}
},
"addr": {
"tcp://google.com:22": {
"reachable": false,
"timeout": 500
},
"tcp://google.com:443": {
"reachable": true,
"timeout": 500
}
},
"port": {
"tcp6:80": {
"listening": true,
"ip": [
"0000:0000:0000:0000:0000:0000:0000:0000"
]
},
"tcp:80": {
"listening": false
},
"tcp:9999": {
"listening": false
}
},
"service": {
"apache2": {
"enabled": true,
"running": true
},
"foobar": {
"enabled": false,
"running": false
}
},
"user": {
"foobar": {
"exists": false
},
"www-data": {
"exists": false
}
},
"group": {
"foobar": {
"exists": false
},
"www-data": {
"exists": true,
"gid": "82"
}
},
"command": {
"apache2 -v": {
"exit-status": "127",
"stdout": [],
"stderr": [
"sh: apache2: not found"
],
"timeout": 10000
},
"foobar": {
"exit-status": "127",
"stdout": [],
"stderr": [
"sh: foobar: not found"
],
"timeout": 10000
}
},
"dns": {
"localhost": {
"resolveable": true,
"addrs": [
"127.0.0.1",
"::1"
],
"timeout": 500
}
},
"process": {
"apache2": {
"running": false
},
"foobar": {
"running": false
}
}
}
68 changes: 68 additions & 0 deletions integration-tests/goss/alpine3/goss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"package": {
"apache2": {
"installed": true,
"versions": [
"2.4.17-r4"
]
}
},
"service": {
"apache2": {
"enabled": true,
"running": true
},
"autofs": {
"enabled": false,
"running": false
}
},
"user": {
"apache": {
"exists": true,
"uid": "1000",
"gid": "1000",
"groups": [
"apache"
],
"home": "/var/www"
}
},
"group": {
"apache": {
"exists": true,
"gid": "1000"
}
},
"command": {
"httpd -v": {
"exit-status": "0",
"stdout": [
"Server version: Apache/2.4.17 (Unix)",
"Server built: Dec 15 2015 12:01:18"
],
"stderr": []
},
"foobar": {
"exit-status": "127",
"stdout": [],
"stderr": [
"foobar: not found"
]
}
},
"process": {
"httpd": {
"running": true
}
},
"port": {
"tcp6:80": {
"listening": true,
"ip": ["0000:0000:0000:0000:0000:0000:0000:0000"]
}
},
"gossfile": {
"../goss-shared.json": {}
}
}
2 changes: 1 addition & 1 deletion integration-tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -xe
cp ../release/goss-linux-amd64 goss/goss

for os in centos6 wheezy precise;do
for os in centos6 wheezy precise alpine3;do
if ! docker images | grep aelsabbahy/goss_$os;then
docker build -t aelsabbahy/goss_$os - < Dockerfile_$os
fi
Expand Down
Loading

0 comments on commit 56508f0

Please sign in to comment.