Project

General

Profile

Tâche #32823

Scénario #32773: Amonecole 2.8.1rc2 : la déclaration de sources interdites ne renvoie pas la bonne page d’erreur

Vérifier/adapter les tests unitaires pour AmonEcole

Added by Joël Cuissinat 6 months ago. Updated 5 months ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
06/21/2021
Due date:
% Done:

100%

Remaining (hours):
0.0

Description

Les tests sont (de nouveau) passants sur Amon : https://dev-eole.ac-dijon.fr/jenkins/job/2.8.1/job/test-moduletests-amon-2.8.1-amd64/ mais signalent qu'il y a des règles supplémentaires sur AmonEcole : https://dev-eole.ac-dijon.fr/jenkins/job/2.8.1/job/test-moduletests-amonecole-2.8.1-amd64/

16:11:11                 def test_web_interdiction():
16:11:11                     """ teste l'interdiction web pour un ou plusieurs postes
16:11:11                     """ 
16:11:11                     p1 = dict(poste=poste1, hdeb='{}:00'.format(hdeb1), hfin='{}:00'.format(hfin1), jdeb=jdeb1, jfin=jfin1, interface=eth)
16:11:11                     p2 = dict(poste=poste2, hdeb=hdeb2, hfin=hfin2, jdeb=jdeb2, jfin=jfin2, interface=eth)
16:11:11                     assert postes.save_forbidden_poste(0, 'web', [p1, p2])
16:11:11                     assert postes.load_forbidden_poste(0, 'web') == [p1, p2]
16:11:11                     assert postes.save_forbidden_poste(0, 'web', [p1])
16:11:11             >       assert postes.generate_postes_rules() == poste1_forbid_rule
16:11:11             E       AssertionError: assert [('/sbin/ipta...CCEPT', None)] == [('/sbin/iptab...PT', 'proxy')]
16:11:11             E         At index 0 diff: ('/sbin/iptables -t nat -I PREROUTING -i eth1 -m multiport -p tcp --dports 3128 -s 1.1.1.1 -m time --timestart 8:0 --timestop 13:0  --weekdays Mon,Tue,Wed,Thu -j DNAT  --to-destination 192.0.2.1:83', 'proxy') != ('/sbin/iptables -t nat -I PREROUTING -i eth1 -m multiport -p tcp --dports 3128 -s 1.1.1.1 -m time --timestart 8:0 --timestop 13:0  --weekdays Mon,Tue,Wed,Thu -j REDIRECT --to-ports 83', 'proxy')
16:11:11             E         Left contains 2 more items, first extra item: ('/sbin/iptables -t nat -A POSTROUTING -s 1.1.1.1 -o containers -j SNAT --to-source 192.0.2.53', 'proxy')
16:11:11             E         ...
16:11:11             E
16:11:11             E         ...Full output truncated (20 lines hidden), use '-vv' to show

Avec des "print()", ça donne :

[('/sbin/iptables -t nat -I PREROUTING -i eth1 -m multiport -p tcp --dports 3128 -s 1.1.1.1 -m time --timestart 8:0 --timestop 13:0  --weekdays Mon,Tue,Wed,Thu -j DNAT  --to-destination 192.0.2.1:83', 'proxy'),
 ('/sbin/iptables -I FORWARD -i eth1 -o containers -s 1.1.1.1 -p tcp --dport 83  -m time --timestart 8:0 --timestop 13:0  --weekdays Mon,Tue,Wed,Thu -j ACCEPT', 'proxy'), ('/sbin/iptables -t nat -A POSTROUTING -s 1.1.1.1 -o containers -j SNAT --to-source 192.0.2.53', 'proxy'),
 ('/sbin/iptables -I INPUT -i br0 -s 1.1.1.1 -p tcp --dport 83  -m time --timestart 8:0 --timestop 13:0  --weekdays Mon,Tue,Wed,Thu -j ACCEPT', None)]

vs

[('/sbin/iptables -t nat -I PREROUTING -i eth1 -m multiport -p tcp --dports 3128 -s 1.1.1.1 -m time --timestart 8:0 --timestop 13:0  --weekdays Mon,Tue,Wed,Thu -j REDIRECT --to-ports 83', 'proxy'),
 ('/sbin/iptables -I INPUT -i eth1 -s 1.1.1.1 -p tcp --dport 83  -m time --timestart 8:0 --timestop 13:0  --weekdays Mon,Tue,Wed,Thu -j ACCEPT', 'proxy')]

Associated revisions

Revision d69d9490 (diff)
Added by Emmanuel GARETTE 6 months ago

Mise à jour des règles iptables pour AmonEcole (ref #32823)

Revision 914b32be (diff)
Added by Emmanuel GARETTE 5 months ago

Mise à jour des règles iptables pour AmonEcole (ref #32823)

History

#1 Updated by Emmanuel GARETTE 6 months ago

  • Status changed from Nouveau to En cours

#2 Updated by Emmanuel GARETTE 6 months ago

  • Assigned To set to Emmanuel GARETTE

#4 Updated by Emmanuel GARETTE 5 months ago

  • Status changed from En cours to Résolu

#5 Updated by Joël Cuissinat 5 months ago

  • Status changed from Résolu to Fermé
  • % Done changed from 0 to 100
  • Remaining (hours) set to 0.0

Test de nouveau passant.

Also available in: Atom PDF