X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestPlc.py;h=57543d1f799f704a686cbc5bb80813a3e50ec050;hb=531f2da33d584e362b600e7925e658f718c4d04f;hp=c50b95201d95dbc50db37632d56a45403b95d18b;hpb=2566bd5e98baa4bccb4a33e50a57b1966816a3a9;p=tests.git diff --git a/system/TestPlc.py b/system/TestPlc.py index c50b952..57543d1 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -24,6 +24,8 @@ from PlcapiUrlScanner import PlcapiUrlScanner from TestBonding import TestBonding +from gethostbyaddr import workaround_gethostbyaddr + has_sfa_cache_filename="sfa-cache" # step methods must take (self) and return a boolean (options is a member of the class) @@ -245,7 +247,7 @@ class TestPlc: # warning, we're now building 'sface' so let's be a bit more picky # full builds are expected to return with 0 here utils.header("Checking if build provides SFA package...") - retcod = utils.system("curl --silent {}/ | grep -q sfa-".format(rpms_url)) == 0 + retcod = utils.system("curl --silent {}/ | grep -q sfa-4".format(rpms_url)) == 0 encoded = 'yes' if retcod else 'no' with open(has_sfa_cache_filename,'w') as cache: cache.write(encoded) @@ -712,13 +714,12 @@ class TestPlc: script_options += " -f {}".format(self.options.fcdistro) script_options += " -r {}".format(repo_url) vserver_name = self.vservername - try: - vserver_hostname = socket.gethostbyaddr(self.vserverip)[0] - script_options += " -n {}".format(vserver_hostname) - except: + vserver_hostname = workaround_gethostbyaddr(self.vserverip) + if not vserver_hostname: print("Cannot reverse lookup {}".format(self.vserverip)) print("This is considered fatal, as this might pollute the test results") return False + script_options += " -n {}".format(vserver_hostname) create_vserver="{build_dir}/{script} {script_options} {vserver_name}".format(**locals()) return self.run_in_host(create_vserver) == 0