X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestPlc.py;h=9555a990b905e74a86859895cc78303fd94f6b51;hb=21e1bb59c72625e686028a83a39cd4675ca39181;hp=7befc3f89d98a3dda0d2639885a1342b0003ab34;hpb=510d4f034ed4bd4f8abb00cf04abcfbe53ab3ccd;p=tests.git diff --git a/system/TestPlc.py b/system/TestPlc.py index 7befc3f..9555a99 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -245,7 +245,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) @@ -359,7 +359,7 @@ class TestPlc: return self.dnf_check_installed(rpms) def pip3_install(self, package): - return self.run_in_guest("pip3 install {}".format(package)) == 0 + return self.run_in_guest(f"pip3 install {package} || pip install {package}") == 0 def auth_root(self): return {'Username' : self.plc_spec['settings']['PLC_ROOT_USER'], @@ -703,6 +703,28 @@ class TestPlc: for level in [ 'arch' ]: repo_url = os.path.dirname(repo_url) + ########## + # on the virsh containers, DNS resolution using gethostbyaddr + # won't work fine, for the hosts under .pl.sophia.inria.fr + # although these IPs can be reversed from virtually everywhere else + # + # this has started with something around fedora35 so I am suspecting python-3.10 + # + # in any case, here's a quick and dirty workaround, as I have bumped my head + # against the screen for two good hours and not found any single clue + # about how to deal with this properly + + import subprocess + + def workaround_gethostaddr(ip): + command = f"host {ip} 8.8.8.8" + completed = subprocess.run(command, shell=True, capture_output=True) + pieces = completed.stdout.decode().split("domain name pointer ") + if len(pieces) == 2: + return pieces[1].replace(".\n", "") + else: + return None + # invoke initvm (drop support for vs) script = "lbuild-initvm.sh" script_options = "" @@ -714,11 +736,14 @@ class TestPlc: vserver_name = self.vservername try: vserver_hostname = socket.gethostbyaddr(self.vserverip)[0] - script_options += " -n {}".format(vserver_hostname) except: - print("Cannot reverse lookup {}".format(self.vserverip)) - print("This is considered fatal, as this might pollute the test results") - return False + # read more above about this workaround + vserver_hostname = workaround_gethostaddr(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 @@ -1521,10 +1546,8 @@ class TestPlc: def install_pip2(self): - # xxx could make sense to mirror this one - replacements = [ - "https://acc.dl.osdn.jp/storage/g/u/un/unitedrpms/32/x86_64/python2-pip-19.1.1-7.fc32.noarch.rpm", + "http://mirror.onelab.eu/third-party/python2-pip-19.1.1-7.fc33.noarch.rpm", ] return ( @@ -1542,8 +1565,9 @@ class TestPlc: # an install from sources and that's quite awkward replacements = [ - "http://mirror.onelab.eu/fedora/releases/31/Everything/x86_64/os/Packages/p/python2-typing-3.6.2-5.fc31.noarch.rpm", - "http://mirror.onelab.eu/fedora/releases/31/Everything/x86_64/os/Packages/p/python2-m2crypto-0.35.2-2.fc31.x86_64.rpm", + # no longer on our mirror + "https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Everything/x86_64/os/Packages/p/python2-typing-3.6.2-5.fc31.noarch.rpm", + "https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Everything/x86_64/os/Packages/p/python2-m2crypto-0.35.2-2.fc31.x86_64.rpm", ] return ( @@ -1551,10 +1575,7 @@ class TestPlc: or self.run_in_guest("pip2 install python2-m2crypto") == 0 or self.run_in_guest("dnf localinstall -y " + " ".join(replacements)) == 0) - # about pip2: - # we can try and use - # that qould then need to be mirrored - # so the logic goes like this + # about pip2: the logic goes like this # check for pip2 command # if not, try dnf install python2-pip # if still not, dnf localinstall the above