6 from vstf.agent.env.driver_plugins import model
7 from vstf.common.utils import check_and_rmmod, check_call
10 class OriginDriverPlugin(model.DriverPlugin):
12 implement for operating linux origin driver modules.
17 list all origin drivers in self.origin_drivers
19 self.origin_drivers = ['ixgbe', 'bnx2x', 'i40e', 'be2net', 'vhost_net']
22 """clean drivers list in self.origin_drivers.
25 for mod in self.origin_drivers:
28 check_and_rmmod('tun')
31 def load(self, drivers):
34 :param list drivers:list of drivers link ['ixgbe','vhost_net']
36 # load implicit 'tun' module dependency for vhost_net
37 if 'vhost_net' in drivers:
38 check_call("modprobe tun", shell=True)
41 check_call("modprobe %s" % drv, shell=True)
45 def get_supported_drivers(self):
46 return self.origin_drivers