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
43b9cd4c
Commit
43b9cd4c
authored
5 years ago
by
Marco Malavolti
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
parent
1ab20a61
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
eccs2.py
+8
-10
8 additions, 10 deletions
eccs2.py
eccs2properties.py
+1
-1
1 addition, 1 deletion
eccs2properties.py
with
9 additions
and
11 deletions
eccs2.py
+
8
−
10
View file @
43b9cd4c
...
@@ -9,11 +9,13 @@ import re
...
@@ -9,11 +9,13 @@ import re
import
requests
import
requests
from
datetime
import
date
from
datetime
import
date
from
eccs2properties
import
ECCS2LOGSDIR
,
ECCS2RESULTSLOG
,
ECCS2CHECKSLOG
,
ECCS2SELENIUMLOG
,
ECCS2SELENIUMLOGLEVEL
,
FEDS_BLACKLIST
,
IDPS_BLACKLIST
,
ECCS2SELENIUMPAGELOADTIMEOUT
,
ECCS2SELENIUMSCRIPTTIMEOUT
from
eccs2properties
import
ECCS2LOGSDIR
,
ECCS2RESULTSLOG
,
ECCS2CHECKSLOG
,
ECCS2SELENIUMLOG
DIR
,
ECCS2SELENIUMLOGLEVEL
,
FEDS_BLACKLIST
,
IDPS_BLACKLIST
,
ECCS2SELENIUMPAGELOADTIMEOUT
,
ECCS2SELENIUMSCRIPTTIMEOUT
from
selenium
import
webdriver
from
selenium
import
webdriver
from
selenium.webdriver.common.by
import
By
from
selenium.webdriver.common.by
import
By
from
selenium.webdriver.common.keys
import
Keys
from
selenium.webdriver.common.keys
import
Keys
from
selenium.webdriver.support.ui
import
Select
from
selenium.webdriver.support.ui
import
Select
from
selenium.webdriver.support.ui
import
WebDriverWait
from
selenium.webdriver.support
import
expected_conditions
as
EC
from
selenium.webdriver.remote.remote_connection
import
LOGGER
from
selenium.webdriver.remote.remote_connection
import
LOGGER
from
selenium.common.exceptions
import
NoSuchElementException
from
selenium.common.exceptions
import
NoSuchElementException
from
selenium.common.exceptions
import
TimeoutException
from
selenium.common.exceptions
import
TimeoutException
...
@@ -46,7 +48,8 @@ def checkIdP(sp,idp,logger,driver):
...
@@ -46,7 +48,8 @@ def checkIdP(sp,idp,logger,driver):
# Open SP, select the IDP from the EDS and press 'Enter' to reach the IdP login page to check
# Open SP, select the IDP from the EDS and press 'Enter' to reach the IdP login page to check
try
:
try
:
driver
.
get
(
sp
)
driver
.
get
(
sp
)
driver
.
find_element_by_id
(
"
idpSelectInput
"
).
send_keys
(
idp
[
'
entityID
'
]
+
Keys
.
ENTER
)
element
=
WebDriverWait
(
driver
,
50
).
until
(
EC
.
presence_of_element_located
((
By
.
ID
,
"
idpSelectInput
"
)))
element
.
send_keys
(
idp
[
'
entityID
'
]
+
Keys
.
ENTER
)
page_source
=
driver
.
page_source
page_source
=
driver
.
page_source
status_code
=
requests
.
get
(
driver
.
current_url
,
verify
=
False
).
status_code
status_code
=
requests
.
get
(
driver
.
current_url
,
verify
=
False
).
status_code
...
@@ -59,13 +62,8 @@ def checkIdP(sp,idp,logger,driver):
...
@@ -59,13 +62,8 @@ def checkIdP(sp,idp,logger,driver):
# If I don't return anything and I don't put anything in the logger
# If I don't return anything and I don't put anything in the logger
# I'll not write on the input files for the table
# I'll not write on the input files for the table
# and I can re-run the command that caused the exception from the "stdout.log" file.
# and I can re-run the command that caused the exception from the "stdout.log" file.
print
(
"
!!! NO SUCH ELEMENT EXCEPTION !!!
"
)
print
(
"
!!! NO SUCH ELEMENT EXCEPTION - RUN AGAIN THE COMMAND !!!
"
)
import
selenium.webdriver.support.ui
as
ui
return
None
wait
=
ui
.
WebDriverWait
(
driver
,
10
)
wait
.
until
(
lambda
driver
:
driver
.
find_element_by_id
(
"
idpSelectInput
"
))
driver
.
find_element_by_id
(
"
idpSelectInput
"
).
send_keys
(
idp
[
'
entityID
'
]
+
Keys
.
ENTER
)
page_source
=
driver
.
page_source
status_code
=
requests
.
get
(
driver
.
current_url
,
verify
=
False
).
status_code
except
UnexpectedAlertPresentException
as
e
:
except
UnexpectedAlertPresentException
as
e
:
logger
.
info
(
"
%s;%s;888;UnexpectedAlertPresent
"
%
(
idp
[
'
entityID
'
],
sp
))
logger
.
info
(
"
%s;%s;888;UnexpectedAlertPresent
"
%
(
idp
[
'
entityID
'
],
sp
))
...
@@ -256,7 +254,7 @@ if __name__=="__main__":
...
@@ -256,7 +254,7 @@ if __name__=="__main__":
checkIdp
(
idp
,
sps
,
eccs2log
,
eccs2checksLog
,
driver
)
checkIdp
(
idp
,
sps
,
eccs2log
,
eccs2checksLog
,
driver
)
#driver.delete_all_cookies()
#driver.delete_all_cookies()
#
driver.close()
driver
.
close
()
driver
.
quit
()
driver
.
quit
()
# Kill process to release resources and to avoid zombies - this reaise an issue
# Kill process to release resources and to avoid zombies - this reaise an issue
...
...
This diff is collapsed.
Click to expand it.
eccs2properties.py
+
1
−
1
View file @
43b9cd4c
...
@@ -34,7 +34,7 @@ ECCS2SELENIUMPAGELOADTIMEOUT = 30
...
@@ -34,7 +34,7 @@ ECCS2SELENIUMPAGELOADTIMEOUT = 30
ECCS2SELENIUMSCRIPTTIMEOUT
=
30
ECCS2SELENIUMSCRIPTTIMEOUT
=
30
# Number of processes to run in parallel
# Number of processes to run in parallel
ECCS2NUMPROCESSES
=
15
ECCS2NUMPROCESSES
=
30
# Registration Authority of Federations to exclude from the check
# Registration Authority of Federations to exclude from the check
FEDS_BLACKLIST
=
[
FEDS_BLACKLIST
=
[
...
...
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