Skip to content

Commit

Permalink
Add test-cases for shell installer
Browse files Browse the repository at this point in the history
  • Loading branch information
ppacher committed Aug 3, 2022
1 parent 50feff3 commit b5cecf9
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,54 @@ jobs:
name: portmaster-next
path: linux/dist/*

test-shell-install:
name: Test curl|bash installer
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: portmaster-current
path: linux

- name: Install tooling
run: sudo bash -c "apt-get update && apt-get install -y systemd desktop-file-utils"
env:
DEBIAN_FRONTEND: noninteractive

- name: Install dependencies
run: sudo apt-get install -y libnetfilter-queue1 ca-certificates
env:
DEBIAN_FRONTEND: noninteractive

- name: Install using SHELL installer
run: yes | sudo bash ./install.sh --assets-url ./installer-assets-*.tar.gz
working-directory: linux

- uses: actions/checkout@v2
- name: Verify installation
run: ./linux/tests/test-install.sh

- uses: actions/download-artifact@v2
with:
name: portmaster-next
path: linux/next

- name: "Upgrade to next pkgrev"
run: yes | sudo bash ./install.sh --assets-url ./next/installer-assets-*.tar.gz
working-directory: linux

- name: Verify upgrade
run: ./linux/tests/test-upgrade.sh

- name: Uninstall portmaster
run: yes | sudo bash ./install.sh --uninstall

- name: Verify uninstallation
run: ./linux/tests/test-uninstall.sh

test-ubuntu:
name: Test DEB package (ubuntu VM)
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ distdir:
mkdir -p ./dist

clean:
rm -r ./portmaster-start ./scripts ./dist icons/ PKGBUILD arch.install nfpm.yaml src pkg portmaster-bin-*.pkg.tar.xz archive.install || true
rm -r ./portmaster-start ./scripts ./dist icons/ PKGBUILD arch.install nfpm.yaml src pkg portmaster-stub-bin-*.pkg.tar.xz archive.install || true

test-debian: build deb
docker run -ti --rm -v $(shell pwd)/dist:/work -w /work debian:latest bash -c 'apt update && apt install -y ca-certificates && dpkg -i /work/portmaster*.deb ; bash'
Expand Down
1 change: 1 addition & 0 deletions linux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ install_or_upgrade() {
rm -rf "${tmp_dir}"

log success "Portmaster is now installed."
log success "Please restart your device to start Portmaster"
exit 0
}

Expand Down
2 changes: 1 addition & 1 deletion linux/templates/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
{{ strings.Indent 1 "# " $nfpm.description -}}
#
pkgname=portmaster-bin
pkgname=portmaster-stub-bin
pkgver={{ index ($nfpm.version | strings.TrimPrefix "v" | strings.SplitN "-" 2) 0 }}
pkgrel={{ index ($nfpm.version | strings.SplitN "-" 2) 1 }}
pkgdesc='Application Firewall: Block Mass Surveillance - Love Freedom'
Expand Down

0 comments on commit b5cecf9

Please sign in to comment.