EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESA
PRISM
VS
Commits
35d6d999
Commit
35d6d999
authored
4 years ago
by
Mussab Abdalla
Browse files
Options
Downloads
Patches
Plain Diff
complete initial report testing
parent
ecca5b0e
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
registrar_test.py
+17
-0
17 additions, 0 deletions
registrar_test.py
registrar_test.sh
+10
-5
10 additions, 5 deletions
registrar_test.sh
with
27 additions
and
5 deletions
registrar_test.py
+
17
−
0
View file @
35d6d999
import
psycopg2
import
os
import
csv
from
xml.etree
import
ElementTree
with
open
(
'
./env/emg_db.env
'
,
'
r
'
)
as
f
:
...
...
@@ -42,6 +43,22 @@ def test_db_name(name):
spamreader
=
csv
.
reader
(
csvfile
)
for
row
in
spamreader
:
identifier
=
row
[
0
].
split
(
'
/
'
)[
4
]
xml_file
=
"
%s.xml
"
%
identifier
tree
=
ElementTree
.
parse
(
xml_file
)
root
=
tree
.
getroot
()
urls
=
root
.
findall
(
'
{http://www.telespazio.com/CSCDA/CDD/PDAS}URL
'
)
wms_link
=
urls
[
0
].
find
(
'
{http://www.telespazio.com/CSCDA/CDD/PDAS}URL
'
).
text
wcs_link
=
urls
[
1
].
find
(
'
{http://www.telespazio.com/CSCDA/CDD/PDAS}URL
'
).
text
wms_capabilities
=
'
emg.pass.copernicus.eu/ows?service=wms&request=GetCapabilities&&cql=identifier=
'
wcs_capabilities
=
'
emg.pass.copernicus.eu/ows?service=wcs&request=GetCapabilities&&cql=identifier=
'
expected_wms_link
=
'
%s
"
%s
"'
%
(
wms_capabilities
,
identifier
)
expected_wcs_link
=
'
%s
"
%s
"'
%
(
wcs_capabilities
,
identifier
)
assert
expected_wms_link
.
replace
(
'
&&
'
,
'
&
'
)
==
wms_link
assert
expected_wcs_link
.
replace
(
'
&&
'
,
'
&
'
)
==
wcs_link
connect_to_db
(
identifier
)
assert
coverage_id
==
identifier
assert
db_name
==
database
...
...
This diff is collapsed.
Click to expand it.
registrar_test.sh
+
10
−
5
View file @
35d6d999
...
...
@@ -2,7 +2,7 @@
product_list_file
=
$1
docker
exec
-i
$(
docker ps
-qf
"name=emg-pvs_registrar"
)
python3 /var/www/pvs/dev/pvs_instance/manage.py storage create pvs_testing pvs_testing
--type
swift
--storage-auth
auth-cloud-ovh
IFS
=
","
# For testing
the
service url and
the
reporting directory canbe fixed and not mapped from env
# For testing
purposses '
service url
'
and
'
reporting directory
' values
can
be fixed and not mapped from env
SERVICE_URL
=
emg.pass.copernicus.eu
REPORTING_DIR
=
/mnt/reports/
while
read
product
;
do
...
...
@@ -15,14 +15,19 @@ echo "docker exec -i $(docker ps -qf "name=emg-pvs_registrar") python3 /core/reg
while
IFS
=
""
read
-r
name
do
docker
exec
$(
docker ps
-qf
"name=emg-pvs_registrar"
)
cat
/mnt/reports/
$name
>>
${
ADDR
[4]
}
.xml
docker
exec
$(
docker ps
-qf
"name=emg-pvs_registrar"
)
cat
/mnt/reports/
$name
>
temp.xml
tail
-n
+2 temp.xml
>
${
ADDR
[4]
}
.xml
done
<
${
ADDR
[4]
}
.csv
rm
${
ADDR
[4]
}
.csv
rm
${
ADDR
[4]
}
.csv
temp.xml
done
<
$product_list_file
pytest
-s
registrar_test.py
--name
$product_list_file
# Remove the created xml reports
while
read
product
;
do
IFS
=
'/'
read
-ra
ADDR
<<<
"
$product
"
rm
${
ADDR
[4]
}
.xml
done
<
$product_list_file
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