diff options
author | Kali Kaneko <kali@leap.se> | 2017-08-28 17:19:12 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-08-30 16:18:50 -0400 |
commit | b9fff80022e15560151f523015cb5bf73bd3cff1 (patch) | |
tree | e9c770266003d47b77244f8588c6c2ccf8dc8390 | |
parent | 04bce963c2314dc9b21bd86224e75c22aae39d70 (diff) |
[tests] do not fail if helper installed in debian path
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | src/leap/bitmask/vpn/helpers/__init__.py | 5 | ||||
-rwxr-xr-x | tests/e2e/e2e-test-vpn.sh | 3 | ||||
-rw-r--r-- | tests/functional/features/steps/bitmask.py | 3 |
4 files changed, 18 insertions, 4 deletions
@@ -1,6 +1,11 @@ DIST=dist/bitmask NEXT_VERSION = $(shell cat pkg/next-version) DIST_VERSION = dist/bitmask-$(NEXT_VERSION)/ + +BITMASK_ROOT = src/leap/bitmask/vpn/helpers/linux/bitmask-root +POLKIT_POLICY = src/leap/bitmask/vpn/helpers/linux/se.leap.bitmask.policy +SUDO = /usr/bin/sudo + include pkg/bundles/build.mk include pkg/thirdparty/openvpn/build.mk @@ -45,6 +50,7 @@ test_functional_setup: pip install -U behave selenium test_functional: install_helpers + test -f /usr/bin/lxpolkit && lkpolkit & xvfb-run --server-args="-screen 0 1280x1024x24" behave --tags ~@wip --tags @smoke tests/functional/features -k --no-capture -D host=localhost test_functional_graphical: @@ -54,8 +60,9 @@ test_functional_graphical_wip: behave --tags @wip tests/functional/features -k --no-capture -D host=localhost install_helpers: - sudo cp src/leap/bitmask/vpn/helpers/linux/bitmask-root /usr/local/sbin/ - sudo cp src/leap/bitmask/vpn/helpers/linux/se.leap.bitmask.policy /usr/share/polkit-1/actions/ + # if there's no sudo, assumming this is running as root by the CI + test -f $(SUDO) && sudo cp $(BITMASK_ROOT) /usr/local/sbin/ || cp $(BITMASK_ROOT) /usr/local/sbin/ + test -f $(SUDO) && sudo cp $(POLKIT_POLICY) /usr/share/polkit-1/actions/se.bitmask.bundle.policy || cp $(POLKIT_POLICY) /usr/share/polkit-1/actions/se.bitmask.bundle.policy install_pixelated: pip install leap.pixelated leap.pixelated-www diff --git a/src/leap/bitmask/vpn/helpers/__init__.py b/src/leap/bitmask/vpn/helpers/__init__.py index 719fc5e9..42cff4a3 100644 --- a/src/leap/bitmask/vpn/helpers/__init__.py +++ b/src/leap/bitmask/vpn/helpers/__init__.py @@ -12,6 +12,7 @@ if IS_LINUX: helper_to = '/usr/local/sbin/bitmask-root' polkit_to = '/usr/share/polkit-1/actions/se.bitmask.bundle.policy' + deb_polkit_to = '/usr/share/polkit-1/actions/se.bitmask.policy' openvpn_to = '/usr/local/sbin/leap-openvpn' def install(): @@ -34,7 +35,9 @@ if IS_LINUX: def check(): helper = os.path.exists(helper_to) - polkit = os.path.exists(polkit_to) + polkit = ( + os.path.exists(polkit_to) or + os.path.exists(deb_polkit_to)) return helper and polkit if IS_MAC: diff --git a/tests/e2e/e2e-test-vpn.sh b/tests/e2e/e2e-test-vpn.sh index 750fef8e..593c1185 100755 --- a/tests/e2e/e2e-test-vpn.sh +++ b/tests/e2e/e2e-test-vpn.sh @@ -59,7 +59,8 @@ sleep 5 # cat /etc/resolv.conf sleep 5 -#ip link show +ip link show +cat ~/.config/leap/bitmaskd.log # TEST that we're going through the provider's VPN tests/e2e/check_ip vpn_on diff --git a/tests/functional/features/steps/bitmask.py b/tests/functional/features/steps/bitmask.py index 7e1201f6..f79cd41c 100644 --- a/tests/functional/features/steps/bitmask.py +++ b/tests/functional/features/steps/bitmask.py @@ -10,11 +10,14 @@ from behave import given @given('I start bitmask for the first time') def initial_run(context): if context.mode == 'virtualenv': + cmd = commands.getoutput('which bitmaskctl') + # print("CMD PATH", cmd) commands.getoutput('bitmaskctl stop') # TODO: fix bitmaskctl to only exit once bitmaskd has stopped time.sleep(2) _initialize_home_path() commands.getoutput('bitmaskctl start') + time.sleep(1) elif context.mode in ('bundle', 'bundle-ci'): commands.getoutput(context.bundle_path) time.sleep(2) |