Add option for scapy path
- For passwordless sudo of specific commands, the full path must be
specified
- Add path for SRBridging tucson topo file
Change-Id: Ib01ebddd175a3e8da6e30578f9786fd031e086f0
diff --git a/TestON/drivers/common/cli/emulator/scapyclidriver.py b/TestON/drivers/common/cli/emulator/scapyclidriver.py
index e5d2deb..b9eea51 100644
--- a/TestON/drivers/common/cli/emulator/scapyclidriver.py
+++ b/TestON/drivers/common/cli/emulator/scapyclidriver.py
@@ -48,6 +48,7 @@
self.scapyPrompt = ">>>"
self.sudoRequired = True
self.ifaceName = None
+ self.scapyPath = "scapy"
def connect( self, **connectargs ):
"""
@@ -65,6 +66,8 @@
self.sudoRequired = False if self.options[ key ] == "false" else True
elif key == "ifaceName":
self.ifaceName = self.options[ key ]
+ elif key == "scapy_path":
+ self.scapyPath = self.options[ key ]
if self.ifaceName is None:
self.ifaceName = self.name + "-eth0"
@@ -162,9 +165,9 @@
try:
main.log.debug( self.name + ": Starting scapy" )
if self.sudoRequired:
- self.handle.sendline( "sudo scapy" )
+ self.handle.sendline( "sudo %s" % self.scapyPath )
else:
- self.handle.sendline( "scapy" )
+ self.handle.sendline( self.scapyPath )
i = self.handle.expect( [ "not found", "password for", self.scapyPrompt ] )
if i == 1:
main.log.debug( "Sudo asking for password" )