def status(all=True): """ Check VPN status :param all: if true, check among all type of connection; if false check only openvpn :return: "Enabled" if a VPN connection is running, "Disabled" otherwise """ if not all: if checkOpenVPN(): return "Enabled" else: return "Disabled" else: if get_running_vpn() is not None: return "Enabled" else: return "Disabled"
def test_status_after_connection(): assert checkOpenVPN()
def test_status_before_connection(): assert not checkOpenVPN()