-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: keliramu <ramunas.keliuotis@nordsec.com>
- Loading branch information
Showing
15 changed files
with
287 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -euxo | ||
|
||
# if host does not have ip6table modules loaded, we must loaded it the docker | ||
if [[ ! $(sudo ip6tables -S) ]]; then | ||
if [[ ! $(command -v modprobe) ]]; then | ||
sudo apt -y install kmod | ||
fi | ||
sudo modprobe ip6table_filter | ||
fi | ||
|
||
echo "~~~REMOVE previous SNAP package" | ||
sudo snap remove --purge nordvpn | ||
|
||
echo "~~~INSTALL new SNAP package" | ||
find "${WORKDIR}"/ -type f -name "*amd64.snap" \ | ||
-exec sudo snap install --dangerous "{}" + | ||
|
||
echo "~~~GRANT permissions - connect snap interfaces" | ||
sudo snap connect nordvpn:network-control | ||
sudo snap connect nordvpn:network-observe | ||
sudo snap connect nordvpn:firewall-control | ||
|
||
echo "~~~INSTALL Snap DONE." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
category="${1}" | ||
pattern="${2}" | ||
|
||
set -ux | ||
|
||
source "${WORKDIR}"/ci/env.sh | ||
|
||
if ! "${WORKDIR}"/ci/install_snap.sh; then | ||
echo "failed to install snap" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "${WORKDIR}"/dist/logs | ||
|
||
cd "${WORKDIR}"/test/qa || exit | ||
|
||
args=() | ||
|
||
case "${category}" in | ||
"all") | ||
;; | ||
*) | ||
args+=("test_${category}.py") | ||
;; | ||
esac | ||
|
||
case "${pattern}" in | ||
"") | ||
;; | ||
*) | ||
args+=("-k ${pattern}") | ||
;; | ||
esac | ||
|
||
|
||
# mkdir -p "${WORKDIR}"/"${COVERDIR}" | ||
|
||
# if ! sudo grep -q "export GOCOVERDIR=${WORKDIR}/${COVERDIR}" "/etc/init.d/nordvpn"; then | ||
# sudo sed -i "1a export GOCOVERDIR=${WORKDIR}/${COVERDIR}" "/etc/init.d/nordvpn" | ||
# fi | ||
|
||
# if [[ -n ${LATTE:-} ]]; then | ||
# if ! sudo grep -q "export IGNORE_HEADER_VALIDATION=1" "/etc/init.d/nordvpn"; then | ||
# sudo sed -i "1a export IGNORE_HEADER_VALIDATION=1" "/etc/init.d/nordvpn" | ||
# fi | ||
|
||
# if ! sudo grep -q "export HTTP_TRANSPORTS=http1" "/etc/init.d/nordvpn"; then | ||
# sudo sed -i "1a export HTTP_TRANSPORTS=http1" "/etc/init.d/nordvpn" | ||
# fi | ||
# fi | ||
|
||
python3 -m pytest -v --disable-pytest-warnings --timeout 180 -x -rsx --timeout-method=thread -o log_cli=true "${args[@]}" | ||
|
||
# if ! sudo grep -q "export GOCOVERDIR=${WORKDIR}/${COVERDIR}" "/etc/init.d/nordvpn"; then | ||
# sudo sed -i "2d" "/etc/init.d/nordvpn" | ||
# fi | ||
|
||
# # To print goroutine profile when debugging: | ||
# RET=$? | ||
# if [ $RET != 0 ]; then | ||
# curl http://localhost:6960/debug/pprof/goroutine?debug=1 | ||
# fi | ||
# exit $RET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.