Skip to content

Commit

Permalink
Use correct interface for LNet in SSI testing (whamcloud#864)
Browse files Browse the repository at this point in the history
* Use correct interface for LNet in SSI testing

Fixes #719

SSI testing is currently using the host interface for LNet. Instead it should be using the LNet interface (.20) as intended.

Signed-off-by: Joe Grund <jgrund@whamcloud.io>

* fix formatting

Signed-off-by: Joe Grund <jgrund@whamcloud.io>

* send config in expected format

Signed-off-by: Joe Grund <jgrund@whamcloud.io>

* add lnd_type

Signed-off-by: Joe Grund <jgrund@whamcloud.io>

* try to avoid server restart

Signed-off-by: Joe Grund <jgrund@whamcloud.io>
  • Loading branch information
jgrund authored Apr 12, 2019
1 parent 6c7e616 commit ecb4a1b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
6 changes: 6 additions & 0 deletions provisioner_output-vagrant-ssi.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"lustre_client_version": "",
"address": "@HOSTNAME@vm@CLUSTER@2@DOMAINNAME@",
"ip_address": "@VM2_IPADDRESS@",
"lnet_address": "@VM2_LNETADDRESS@",
"distro": "el7.4"
}
],
Expand Down Expand Up @@ -132,6 +133,7 @@
"root_password": "vagrant",
"address": "@HOSTNAME@vm@CLUSTER@5@DOMAINNAME@",
"ip_address": "@VM5_IPADDRESS@",
"lnet_address": "@VM5_LNETADDRESS@",
"distro": "el7.4"
},
{
Expand Down Expand Up @@ -160,6 +162,7 @@
"root_password": "vagrant",
"address": "@HOSTNAME@vm@CLUSTER@6@DOMAINNAME@",
"ip_address": "@VM6_IPADDRESS@",
"lnet_address": "@VM6_LNETADDRESS@",
"distro": "el7.4"
},
{
Expand Down Expand Up @@ -188,6 +191,7 @@
"root_password": "vagrant",
"address": "@HOSTNAME@vm@CLUSTER@7@DOMAINNAME@",
"ip_address": "@VM7_IPADDRESS@",
"lnet_address": "@VM7_LNETADDRESS@",
"distro": "el7.4"
},
{
Expand Down Expand Up @@ -216,6 +220,7 @@
"root_password": "vagrant",
"address": "@HOSTNAME@vm@CLUSTER@8@DOMAINNAME@",
"ip_address": "@VM8_IPADDRESS@",
"lnet_address": "@VM8_LNETADDRESS@",
"distro": "el7.4"
},
{
Expand All @@ -239,6 +244,7 @@
"root_password": "vagrant",
"address": "@HOSTNAME@vm@CLUSTER@9@DOMAINNAME@",
"ip_address": "@VM9_IPADDRESS@",
"lnet_address": "@VM9_LNETADDRESS@",
"distro": "el7.4"
}
],
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ exclude = '''
\.git
| \.tox
| \.venv
| \.cargo
| _build
| build
| dist
| south_migrations
| target
)/
'''
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ else
-e "s/@VM7_IPADDRESS@/10.73.10.23/g" \
-e "s/@VM8_IPADDRESS@/10.73.10.24/g" \
-e "s/@VM9_IPADDRESS@/10.73.10.39/g" \
-e "s/@VM2_IPADDRESS@/10.73.20.32/g" \
-e "s/@VM2_LNETADDRESS@/10.73.20.32/g" \
-e "s/@VM5_LNETADDRESS@/10.73.20.21/g" \
-e "s/@VM6_LNETADDRESS@/10.73.20.22/g" \
-e "s/@VM7_LNETADDRESS@/10.73.20.23/g" \
-e "s/@VM8_LNETADDRESS@/10.73.20.24/g" \
-e "s/@VM9_LNETADDRESS@/10.73.20.39/g" \
< "$CHROMA_DIR"/provisioner_output-vagrant-"${MAKE_TARGET%_tests}".json.in \
> provisioner_output.json
fi
Expand Down
31 changes: 31 additions & 0 deletions tests/integration/core/chroma_integration_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,31 @@ def check_for_HYD_2849_4050():

self.wait_for_commands(self.chroma_manager, command_ids, timeout=INSTALL_TIMEOUT)

def configure_lnet(self, host):
host_config = self.get_host_config(host["nodename"])

if host_config is None:
logger.warning("No host config for '{}'".format(host["nodename"]))
return

info = self._get_lnet_info(host)

def convert(ni):
lnd_network = 0 if ni.get("inet4_address") == host_config["lnet_address"] else -1

return {"lnd_network": lnd_network, "lnd_type": "tcp", "network_interface": ni["resource_uri"]}

objects = map(convert, info.network_interfaces)

logger.info("updating LNet to: {}".format(objects))

response = self.chroma_manager.post("/api/nid/", body={"objects": objects})

self.assertTrue(response.successful, response.text)
command_id = response.json["command"]["id"]

self.wait_for_command(self.chroma_manager, command_id, timeout=LONG_TEST_TIMEOUT)

def _add_hosts(self, addresses, auth_type):
"""Add a list of lustre server addresses to chroma and ensure lnet ends in the correct state."""
self.validate_hosts(addresses, auth_type)
Expand All @@ -260,6 +285,12 @@ def _add_hosts(self, addresses, auth_type):
expected_return_code=None,
)

for host in new_hosts:
profile = self.get_current_host_profile(host)

if profile.get("managed") or profile.get("worker"):
self.configure_lnet(host)

for host in new_hosts:
# Deal with pre-3.0 versions.
if host["state"] in ["lnet_up", "lnet_down", "lnet_unloaded"]:
Expand Down
12 changes: 2 additions & 10 deletions tests/integration/core/remote_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,27 +951,19 @@ def clear_ha(self, server_list):
def clear_lnet_config(self, server_list):
"""
Removes the lnet configuration file for the server list passed.
"""
"""

# This isn't really that bad because the file will not be recreated if I delete it so probably ammounts
# to at most an extra reboot cycle per test session.
# Note the sleep ensures the reboot really happens otherwise it might look alive in the await_server_boot
for server in server_list:
self._ssh_address(
server["address"],
"""
[ -f /etc/modprobe.d/iml_lnet_module_parameters.conf ] &&
rm -f /etc/modprobe.d/iml_lnet_module_parameters.conf &&
reboot &&
sleep 20
lustre_rmmod
""",
expected_return_code=None,
) # Keep going if it failed - may be none there.

# Now ensure they have all comeback to life
for server in server_list:
self.await_server_boot(server["fqdn"], restart=True)

def install_upgrades(self):
raise NotImplementedError("Automated test of upgrades is HYD-1739")

Expand Down

0 comments on commit ecb4a1b

Please sign in to comment.