From cb5fadd36904f1b95948592d6a98f1da9eba575a Mon Sep 17 00:00:00 2001 From: Pridhiviraj Paidipeddi Date: Sun, 24 Jun 2018 18:23:57 +0530 Subject: [PATCH] InstallRhel: Fix setting hostname properly Currently hostname is set with ip address during rhel OS installation. This patch fixes it by setting the hostname with dns name properly. For this user need to suppy host name in --host-name Fixes: https://github.com/open-power/op-test-framework/issues/261 Signed-off-by: Pridhiviraj Paidipeddi --- OpTestConfiguration.py | 1 + testcases/InstallRhel.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpTestConfiguration.py b/OpTestConfiguration.py index 1fd6e3fb7..05ce190f0 100644 --- a/OpTestConfiguration.py +++ b/OpTestConfiguration.py @@ -96,6 +96,7 @@ def get_parser(): help="Prompt for Host SSH session") hostinstgroup = parser.add_argument_group('Host OS Install', 'Options for installing an OS on the Host') + hostinstgroup.add_argument("--host-name", help="Host name", default="localhost") hostinstgroup.add_argument("--host-gateway", help="Host Gateway", default="") hostinstgroup.add_argument("--host-submask", help="Host Subnet Mask", default="255.255.255.0") hostinstgroup.add_argument("--host-mac", diff --git a/testcases/InstallRhel.py b/testcases/InstallRhel.py index 0fb2461ca..a4a7011bd 100644 --- a/testcases/InstallRhel.py +++ b/testcases/InstallRhel.py @@ -46,6 +46,8 @@ def setUp(self): self.fail("Provide host user details refer, --host-{user,password}") if not self.conf.args.host_scratch_disk: self.fail("Provide proper host disk to install refer, --host-scratch-disk") + if not self.conf.args.host_name: + self.fail("Provide hostname to be set during installation") def runTest(self): self.system.goto_state(OpSystemState.PETITBOOT_SHELL) @@ -84,7 +86,7 @@ def runTest(self): self.host.ip, self.conf.args.host_gateway, self.conf.args.host_submask, - self.host.hostname(), + self.conf.args.host_name, self.conf.args.host_dns, ks_url) self.c = self.system.sys_get_ipmi_console()