Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Connectivity Check
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Connectivity Check
Commits
0fa338dd
Commit
0fa338dd
authored
5 years ago
by
Marco Malavolti
Browse files
Options
Downloads
Patches
Plain Diff
Added logging
parent
f5d90b8a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eccs2.py
+12
-1
12 additions, 1 deletion
eccs2.py
with
12 additions
and
1 deletion
eccs2.py
+
12
−
1
View file @
0fa338dd
...
...
@@ -6,12 +6,14 @@ from selenium.webdriver.support.ui import Select
from
selenium.webdriver.common.keys
import
Keys
from
selenium.common.exceptions
import
NoSuchElementException
from
selenium.common.exceptions
import
TimeoutException
import
logging
"""
Apre un SP con Discovery Service, seleziona l
'
IdP di cui fare il test e lo raggiunge iniziando una vera sessione via browser.
A noi serve fare un test di accesso e presentazione della pagina di Login su 2 SP dislocati geograficamente in punti diversi.
Per questo erano stati scelti SP24(IDEM) e l
'
Attribute Viewer (SWITCH). Se il test fallisce su entrambi, allora non va bene.
Per questo sono stati scelti SP24(IDEM) e l
'
Attribute Viewer (SWITCH). Se il test fallisce su entrambi, allora non va bene.
Questo script funziona SOLO con SP aventi Embedded Discovery Service come DS.
"""
def
logFile
(
idp
,
content
):
...
...
@@ -59,6 +61,7 @@ def checkIdP(driver,sp,idp):
except
NoSuchElementException
as
e
:
pass
except
TimeoutException
as
e
:
logging
.
info
(
"
%s;%s;TIMEOUT
"
%
(
idp
,
sp
))
return
"
TIMEOUT
"
pattern_metadata
=
"
Unable.to.locate(\sissuer.in|).metadata(\sfor|)|no.metadata.found|profile.is.not.configured.for.relying.party|Cannot.locate.entity|fail.to.load.unknown.provider|does.not.recognise.the.service|unable.to.load.provider|Nous.n
'
avons.pas.pu.(charg|charger).le.fournisseur.de service|Metadata.not.found|application.you.have.accessed.is.not.registered.for.use.with.this.service|Message.did.not.meet.security.requirements
"
...
...
@@ -71,10 +74,13 @@ def checkIdP(driver,sp,idp):
password_found
=
re
.
search
(
pattern_password
,
driver
.
page_source
,
re
.
I
)
if
(
metadata_not_found
):
logging
.
info
(
"
%s;%s;No-eduGAIN-Metadata
"
%
(
idp
,
sp
))
return
"
No-eduGAIN-Metadata
"
elif
not
username_found
and
not
password_found
:
logging
.
info
(
"
%s;%s;Invalid-Form
"
%
(
idp
,
sp
))
return
"
Invalid Form
"
else
:
logging
.
info
(
"
%s;%s;OK
"
%
(
idp
,
sp
))
return
"
OK
"
def
setup
():
...
...
@@ -94,6 +100,11 @@ def setup():
if
__name__
==
"
__main__
"
:
import
os
os
.
remove
(
"
eccs2.log
"
)
logging
.
basicConfig
(
format
=
'
%(message)s
'
,
filename
=
'
eccs2.log
'
,
level
=
logging
.
INFO
)
driver
=
setup
()
sps
=
[
"
https://sp24-test.garr.it/secure
"
,
"
https://attribute-viewer.aai.switch.ch/eds/
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment