[global/rid] Commit associé à http://git.crans.org/?p=usr-scripts.git;a=commit;h=a442fd6b22c400800e7c5bd870e83e4027a1d76f
* Maintenant, on va pouvoir identifier formellement les machines v6-only et les autres, sans perdre la possibilité de passer de l'une à l'autre rapidement (avec les changements qui vont bien)
This commit is contained in:
parent
60ded9f830
commit
cd75ed7bd4
5 changed files with 79 additions and 35 deletions
17
test.py
17
test.py
|
@ -49,6 +49,13 @@ machine_ldif = {
|
|||
'host' : [u"autotest-%s.crans.org" % randomStr() ]
|
||||
}
|
||||
|
||||
borne_ldif = {
|
||||
'macAddress' : [randomMAC()],
|
||||
'host' : ["autotest-%s.crans.org" % randomStr() ],
|
||||
'canal' : ["11"],
|
||||
'puissance' : ["52 khz"],
|
||||
}
|
||||
|
||||
club_ldif = {
|
||||
'nom' : [ u'autotest-club' ],
|
||||
'chbre' : [ u'EXT' ],
|
||||
|
@ -90,6 +97,8 @@ def test_list_of_dict(keys, list):
|
|||
anim("\tTest de l'attribut %s" % key)
|
||||
ok = True
|
||||
for item in list:
|
||||
if key == "chbre":
|
||||
print item['aid'][0]
|
||||
try: item.get(key, [])
|
||||
except psycopg2.OperationalError as error:
|
||||
print ERREUR
|
||||
|
@ -108,7 +117,11 @@ def tests_machines(parent_dn, realm_list, ipsec=False):
|
|||
for realm in realm_list:
|
||||
anim("Creation de machines %s" % realm)
|
||||
try:
|
||||
machine = conn.newMachine(parent_dn, realm, machine_ldif)
|
||||
if realm == 'bornes':
|
||||
mldif = borne_ldif
|
||||
else:
|
||||
mldif = machine_ldif
|
||||
machine = conn.newMachine(parent_dn, realm, mldif)
|
||||
if ipsec: machine['ipsec'] = u'auto'
|
||||
machine.create()
|
||||
except Exception as error:
|
||||
|
@ -189,7 +202,7 @@ else:
|
|||
print OK
|
||||
|
||||
tests_machines(adherent.dn, ["adherents", "fil-v6", "personnel-ens"])
|
||||
tests_machines(adherent.dn, ["wifi", "wifi-v6"], ipsec=True)
|
||||
tests_machines(adherent.dn, ["wifi-adh", "wifi-v6"], ipsec=True)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue