Exemplo n.º 1
0
 def test_grep(self):
     res = Executor.exec("vboxmanage list vms | "
             "grep -c \\\"{vmname}\\\"  ".format(vmname="Island"))
     print(not not res)
Exemplo n.º 2
0
 def test_ipfetch(self):
     import re
     res = Executor.exec('vboxmanage guestcontrol Island run --exe "/sbin/ip" --username root --password islands  --wait-stdout -- ip a  | grep eth1')
     v = re.search(r'(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)', res).group()
     print("OUTPUT IS %s" % v)