From b0c445bed88b16fbdf640024f3df389f68130c70 Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Thu, 1 Apr 2021 16:46:12 +0200 Subject: [PATCH] updated netconf test data download script --- test/data/netdash-alldevices.txt | 7 +++++ test/data/update_netconf_data.py | 54 ++++++++++++-------------------- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/test/data/netdash-alldevices.txt b/test/data/netdash-alldevices.txt index e1a6c0b9..76360070 100644 --- a/test/data/netdash-alldevices.txt +++ b/test/data/netdash-alldevices.txt @@ -29,6 +29,13 @@ mx2.lju.si.geant.net mx2.rig.lv.geant.net mx2.tal.ee.geant.net mx2.zag.hr.geant.net +rt2.ams.nl.geant.net +rt1.kau.lt.geant.net +rt2.kau.lt.geant.net +rt1.rig.lv.geant.net +rt2.rig.lv.geant.net +rt1.tal.ee.geant.net +rt2.tal.ee.geant.net qfx.fra.de.geant.net qfx.par.fr.geant.net qfx.lon2.uk.geant.net diff --git a/test/data/update_netconf_data.py b/test/data/update_netconf_data.py index 4d0462c8..208b87d8 100644 --- a/test/data/update_netconf_data.py +++ b/test/data/update_netconf_data.py @@ -24,39 +24,25 @@ def _load_netconf(hostname, ssh_params): def _routers(): - return [ - 'mx1.ham.de.geant.net', - 'mx1.dub.ie.geant.net', - 'mx1.vie.at.geant.net', - 'mx2.rig.lv.geant.net', - 'mx1.mil2.it.geant.net', - 'mx2.bra.sk.geant.net', - 'mx1.ams.nl.geant.net', - 'mx1.dub2.ie.geant.net', - 'mx2.bru.be.geant.net', - 'mx1.ath2.gr.geant.net', - 'mx2.zag.hr.geant.net', - 'mx1.tal.ee.geant.net', - 'mx1.bud.hu.geant.net', - 'mx1.buc.ro.geant.net', - 'mx1.kau.lt.geant.net', - 'mx1.mad.es.geant.net', - 'mx1.fra.de.geant.net', - 'mx2.tal.ee.geant.net', - 'mx1.poz.pl.geant.net', - 'mx2.lis.pt.geant.net', - 'mx1.lon.uk.geant.net', - 'mx1.lon2.uk.geant.net', - 'mx2.kau.lt.geant.net', - 'mx1.pra.cz.geant.net', - 'mx1.par.fr.geant.net', - 'mx2.lju.si.geant.net', - 'mx1.sof.bg.geant.net', - 'mx1.mar.fr.geant.net', - 'mx2.ath.gr.geant.net', - 'mx1.lis.pt.geant.net', - 'mx1.gen.ch.geant.net', - ] + filename = os.path.realpath(os.path.join( + os.path.dirname(__file__), + 'netdash-alldevices.txt')) + + with open(filename) as f: + for hostname in f.readlines(): + hostname = hostname.strip() + if hostname in { + 'mx1.kau.lt.geant.net', + 'mx1.tal.ee.geant.net', + 'mx2.kau.lt.geant.net', + 'mx2.rig.lv.geant.net', + 'mx2.tal.ee.geant.net', + 'srx1.am.office.geant.net', + 'srx2.am.office.geant.net', + 'srx1.ch.office.geant.net', + 'srx2.ch.office.geant.net'}: + continue + yield hostname if __name__ == "__main__": @@ -67,7 +53,7 @@ if __name__ == "__main__": CONFIG_FILENAME = "config.json" SCHEMA_FILENAME = os.path.join(TEST_DATA_DIR, "juniper-netconf.xsd") - with open("config.json") as f: + with open(CONFIG_FILENAME) as f: params = config.load(f) for r in _routers(): logging.info("router: " + r) -- GitLab