Commit ad44963c authored by Yonghong Song's avatar Yonghong Song

python commands module is removed in python 3, use subprocess

Signed-off-by: default avatarYonghong Song <yhs@plumgrid.com>
parent a5c3c707
......@@ -73,7 +73,6 @@ import sys
from time import sleep
from unittest import main, TestCase
import subprocess
import commands
import struct
arg1 = sys.argv.pop(1)
......@@ -232,8 +231,10 @@ class TestBPFSocket(TestCase):
self.config_router_ns(self.ns_router, self.vm1_rtr_ip, self.vm2_rtr_ip)
# get vm mac address
self.vm1_mac = commands.getoutput('ip netns exec ' + self.ns1 + ' cat /sys/class/net/eth0/address')
self.vm2_mac = commands.getoutput('ip netns exec ' + self.ns2 + ' cat /sys/class/net/eth0/address')
self.vm1_mac = subprocess.check_output(["ip", "netns", "exec", self.ns1, "cat", "/sys/class/net/eth0/address"])
self.vm1_mac = self.vm1_mac.strip()
self.vm2_mac = subprocess.check_output(["ip", "netns", "exec", self.ns2, "cat", "/sys/class/net/eth0/address"])
self.vm2_mac = self.vm2_mac.strip()
# load the program and configure maps
self.config_maps()
......
......@@ -66,7 +66,6 @@ import sys
from time import sleep
from unittest import main, TestCase
import subprocess
import commands
arg1 = sys.argv.pop(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment