summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kpov_judge/tasks/openvpn_simple_smb/task.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py
index 4783486..ef7d48a 100644
--- a/kpov_judge/tasks/openvpn_simple_smb/task.py
+++ b/kpov_judge/tasks/openvpn_simple_smb/task.py
@@ -111,18 +111,22 @@ params_meta = {
def task(IP_NM, DNS_NM, IP_static, DNS_static):
- import pxssh
- import pexpect
+ import pxssh # Used to set up an SSH connection to a remote machine
+ import pexpect # Allows the script to spawn a child application and control it as if a human were typing commands
+ # the necessary things we need to check if the task was performed correctly
results = dict()
+ # The login params (these must be used on the machines!)
peer_user = 'student'
peer_passwd = 'vaje'
+ # Sets up the SSH connections to the machines
sA = pxssh.pxssh()
sB = pxssh.pxssh()
+ # Logs in to the machines with the default login params
sA.login(IP_NM, peer_user, peer_passwd)
sB.login(IP_static, peer_user, peer_passwd)
@@ -136,9 +140,22 @@ def task(IP_NM, DNS_NM, IP_static, DNS_static):
results['static_nmcli'] = sB.run('nmcli d')
results['static_nslookup'] = sB.run('nslookup www.arnes.si')
+ # Check if the tap exists
+ # Must return a non-empty string
+ results['is_tap_exists'] = sA.run('ls /sys/class/net | grep "tap0"');
+ # Check if the VPN server is running
+ # Must return a non-empty string
+ results['is_VPN_running'] = sA.run('ls /sys/class/net | grep "tun0"');
+
+ # Check if both clients are connected
+ #
+ #
+
+
sA.logout()
sB.logout()
+
return results