diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-06-28 16:17:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-06-28 16:17:27 +0000 |
commit | eb54a9e65e838e092e5acb5a8bd4119dd2e9f556 (patch) | |
tree | 41af1dad6cd4fe99638f29b92cb7cfbb70987fdb /yardstick/benchmark/contexts/standalone/sriov.py | |
parent | 931c7d87597fd61f9e300be2637a0bdd485001d9 (diff) | |
parent | 90919566f056e1881c7d35c45ef6dc9725dcf18e (diff) |
Merge "Extended Context class with get_physical_nodes functionality" into stable/fraser
Diffstat (limited to 'yardstick/benchmark/contexts/standalone/sriov.py')
-rw-r--r-- | yardstick/benchmark/contexts/standalone/sriov.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/yardstick/benchmark/contexts/standalone/sriov.py b/yardstick/benchmark/contexts/standalone/sriov.py index c5438b3cf..5822feb37 100644 --- a/yardstick/benchmark/contexts/standalone/sriov.py +++ b/yardstick/benchmark/contexts/standalone/sriov.py @@ -109,6 +109,22 @@ class SriovContext(Context): build_vfs = "echo 0 > /sys/bus/pci/devices/{0}/sriov_numvfs" self.connection.execute(build_vfs.format(ports.get('phy_port'))) + def _get_physical_nodes(self): + return self.nfvi_host + + def _get_physical_node_for_server(self, server_name): + + # self.nfvi_host always contain only one host. + node_name, ctx_name = self.split_host_name(server_name) + if ctx_name is None or self.name != ctx_name: + return None + + matching_nodes = [s for s in self.servers if s == node_name] + if len(matching_nodes) == 0: + return None + + return "{}.{}".format(self.nfvi_host[0]["name"], self._name) + def _get_server(self, attr_name): """lookup server info by name from context |