Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
34d33db6
Commit
34d33db6
authored
7 years ago
by
gakin
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-5087 : test_openbis_sync
SVN: 38131
parent
febf5d56
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
integration-tests/templates/test_openbis_sync/harvester_config/harvester-config.txt
+1
-1
1 addition, 1 deletion
...s/test_openbis_sync/harvester_config/harvester-config.txt
integration-tests/test_openbis_sync.py
+10
-7
10 additions, 7 deletions
integration-tests/test_openbis_sync.py
with
11 additions
and
8 deletions
integration-tests/templates/test_openbis_sync/harvester_config/harvester-config.txt
+
1
−
1
View file @
34d33db6
...
@@ -30,5 +30,5 @@ email-addresses = ganime.akin@id.ethz.ch, ganime@gmail.com
...
@@ -30,5 +30,5 @@ email-addresses = ganime.akin@id.ethz.ch, ganime@gmail.com
dry-run = false
dry-run = false
#default = false
#default = false
verbose =
fals
e
verbose =
tru
e
This diff is collapsed.
Click to expand it.
integration-tests/test_openbis_sync.py
+
10
−
7
View file @
34d33db6
...
@@ -182,7 +182,9 @@ class TestCase(systemtest.testcase.TestCase):
...
@@ -182,7 +182,9 @@ class TestCase(systemtest.testcase.TestCase):
self
.
writeResponseToFile
(
datasource_graph_response
,
file1
)
self
.
writeResponseToFile
(
datasource_graph_response
,
file1
)
content1
=
self
.
readLinesFromFile
(
file1
)
content1
=
self
.
readLinesFromFile
(
file1
)
content1
.
sort
()
content1
.
sort
()
# for line in content1:
# util.printAndFlush(line)
'''
read entity graph from harvester
'''
read entity graph from harvester
the entities might be translated using a prefix specified in the harvester_config
the entities might be translated using a prefix specified in the harvester_config
remove the prefix
'''
remove the prefix
'''
...
@@ -201,7 +203,7 @@ class TestCase(systemtest.testcase.TestCase):
...
@@ -201,7 +203,7 @@ class TestCase(systemtest.testcase.TestCase):
output
.
write
(
"
%s
\n
"
%
item
)
output
.
write
(
"
%s
\n
"
%
item
)
if
item
.
startswith
(
"
label
"
)
==
False
:
if
item
.
startswith
(
"
label
"
)
==
False
:
same
=
False
same
=
False
self
.
assertEquals
(
"
The entity graphs on datasource and harvester are
not
equal
"
,
True
,
same
)
self
.
assertEquals
(
"
The entity graphs on datasource and harvester are equal
"
,
True
,
same
)
if
same
==
False
:
if
same
==
False
:
self
.
fail
(
"
The entity graphs on datasource and harvester are not equal.See %s for details
"
%
os
.
path
.
join
(
destination
,
"
diff.txt
"
))
self
.
fail
(
"
The entity graphs on datasource and harvester are not equal.See %s for details
"
%
os
.
path
.
join
(
destination
,
"
diff.txt
"
))
...
@@ -218,7 +220,6 @@ class TestCase(systemtest.testcase.TestCase):
...
@@ -218,7 +220,6 @@ class TestCase(systemtest.testcase.TestCase):
def
readLinesFromFile
(
self
,
input_file
):
def
readLinesFromFile
(
self
,
input_file
):
with
open
(
input_file
,
'
rb
'
)
as
f
:
with
open
(
input_file
,
'
rb
'
)
as
f
:
content
=
f
.
readlines
()
content
=
f
.
readlines
()
print
content
return
content
return
content
def
removePrefixFromLines
(
self
,
lines
,
prefix
):
def
removePrefixFromLines
(
self
,
lines
,
prefix
):
...
@@ -254,11 +255,13 @@ class TestCase(systemtest.testcase.TestCase):
...
@@ -254,11 +255,13 @@ class TestCase(systemtest.testcase.TestCase):
def
installPlugin
(
self
,
openbisController
,
plugin_name
):
def
installPlugin
(
self
,
openbisController
,
plugin_name
):
repository
=
GitLabArtifactRepository
(
self
.
artifactRepository
.
localRepositoryFolder
)
repository
=
GitLabArtifactRepository
(
self
.
artifactRepository
.
localRepositoryFolder
)
path
=
repository
.
getPathToArtifact
(
'
10
'
,
'
archive.zip
'
)
path
=
repository
.
getPathToArtifact
(
'
10
'
,
'
archive.zip
'
)
util
.
printAndFlush
(
"
path to core plugin in the
repository: %s
"
%
path
)
util
.
printAndFlush
(
"
downloaded
repository
as
: %s
"
%
path
)
destination
=
"
%s/servers/core-plugins/%s/
"
%
(
openbisController
.
installPath
,
openbisController
.
instanceName
)
destination
=
"
%s/servers/core-plugins/%s/
"
%
(
openbisController
.
installPath
,
openbisController
.
instanceName
)
util
.
printAndFlush
(
"
Unzipping plugin % s into folder %s
"
%
(
plugin_name
,
destination
))
commit_id
=
self
.
getLatestCommitHashForCorePlugin
(
'
sissource.ethz.ch
'
,
10
)
commit_id
=
self
.
getLatestCommitHashForCorePlugin
(
'
sissource.ethz.ch
'
,
10
)
util
.
unzipSubfolder
(
path
,
'
OpenbisSync-master-%s/core-plugins/%s/1/
'
%
(
commit_id
,
plugin_name
),
destination
)
path_in_archive
=
"
OpenbisSync-master-%s
"
%
commit_id
util
.
printAndFlush
(
"
path to plugin in repository repository as : %s
"
%
path_in_archive
)
util
.
printAndFlush
(
"
Unzipping plugin % s into folder %s
"
%
(
plugin_name
,
destination
))
util
.
unzipSubfolder
(
path
,
path_in_archive
+
"
/core-plugins/%s/1/
"
%
plugin_name
,
destination
)
def
installDataSourcePlugin
(
self
,
openbisController
,
dss_port
):
def
installDataSourcePlugin
(
self
,
openbisController
,
dss_port
):
self
.
installPlugin
(
openbisController
,
"
datasource
"
)
self
.
installPlugin
(
openbisController
,
"
datasource
"
)
...
@@ -274,7 +277,7 @@ class TestCase(systemtest.testcase.TestCase):
...
@@ -274,7 +277,7 @@ class TestCase(systemtest.testcase.TestCase):
'''
update db source plugin.properties
'''
'''
update db source plugin.properties
'''
datasource_core_plugin_properties
=
"
%s/1/dss/data-sources/openbis-db/plugin.properties
"
%
openbisController
.
instanceName
datasource_core_plugin_properties
=
"
%s/1/dss/data-sources/openbis-db/plugin.properties
"
%
openbisController
.
instanceName
plugin_properties_file
=
os
.
path
.
join
(
openbisController
.
installPath
,
"
servers
"
,
"
core-plugins
"
,
datasource_core_plugin_properties
)
plugin_properties_file
=
os
.
path
.
join
(
openbisController
.
installPath
,
"
servers
"
,
"
core-plugins
"
,
datasource_core_plugin_properties
)
util
.
printAndFlush
(
"
Updating %s
"
%
plugin_properties_file
)
util
.
printAndFlush
(
"
Updating
db source
%s
"
%
plugin_properties_file
)
pluginProps
=
util
.
readProperties
(
plugin_properties_file
)
pluginProps
=
util
.
readProperties
(
plugin_properties_file
)
pluginProps
[
'
databaseKind
'
]
=
openbisController
.
databaseKind
pluginProps
[
'
databaseKind
'
]
=
openbisController
.
databaseKind
util
.
writeProperties
(
plugin_properties_file
,
pluginProps
)
util
.
writeProperties
(
plugin_properties_file
,
pluginProps
)
...
...
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