Skip to content

Commit

Permalink
test: apk package installation
Browse files Browse the repository at this point in the history
  • Loading branch information
thediveo committed Sep 22, 2023
1 parent 54bff27 commit a4ec751
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ nfpms:
dependencies:
- desktop-file-utils
overrides:
apk:
dependencies:
- wireshark-common
- desktop-file-utils
deb:
dependencies:
- wireshark-common
Expand Down
2 changes: 1 addition & 1 deletion packaging/linux/post-install.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
#!/bin/sh
update-desktop-database
2 changes: 1 addition & 1 deletion packaging/linux/post-remove.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
#!/bin/sh
update-desktop-database
4 changes: 4 additions & 0 deletions packaging/linux/test/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Do a test installation of the cshargextcap*.apk package on Alpine.
FROM alpine:latest
COPY install.sh /
CMD ["/bin/sh", "install.sh"]
26 changes: 26 additions & 0 deletions packaging/linux/test/alpine/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
set -e

RED="\033[1;31m"
GREEN="\033[1;32m"
NOCOLOR="\033[0m"

# test harness
apk update
apk add xdg-utils

# the real deal...
apk add --allow-untrusted /dist/cshargextcap_*_amd64.apk

apk add tshark

# Ask tshark to tell us the extcap interfaces it knows of: this must list the
# packetflix extcap so we know we've installed the plugin properly.
tshark -D | grep packetflix \
&& echo -e "${GREEN}OK:${NOCOLOR} tshark detects extcap plugin" \
|| (echo -e "${RED}FAIL:${NOCOLOR} tshark doesn't detect the packetflix extcap"; exit 1)

# Check that the default URL scheme handler registration is in place.
xdg-mime query default x-scheme-handler/packetflix | grep "packetflix.desktop" \
&& echo -e "${GREEN}OK:${NOCOLOR} packetflix URL scheme handler registered" \
|| (echo -e "${RED}FAIL:${NOCOLOR} packetflix URL scheme handler not detected"; exit 1)
12 changes: 12 additions & 0 deletions packaging/linux/test/alpine/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e


RED="\033[1;31m"
GREEN="\033[1;32m"
NOCOLOR="\033[0m"

docker build --pull -f Dockerfile -t cshargextcap-alpine-test-install .
docker run --rm --name cshargextcap-alpine-test-install -v ./../../../../dist:/dist cshargextcap-alpine-test-install \
&& echo -e "${GREEN}SUCCESS${NOCOLOR}" \
|| (echo -e "${RED}FAIL${NOCOLOR}"; exit 1)

0 comments on commit a4ec751

Please sign in to comment.