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
b51dd8f8
Commit
b51dd8f8
authored
14 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-1546 refactor common integration test sources
SVN: 16729
parent
8074f151
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
integration-tests/common.bash
+57
-25
57 additions, 25 deletions
integration-tests/common.bash
with
57 additions
and
25 deletions
integration-tests/common.bash
+
57
−
25
View file @
b51dd8f8
...
@@ -13,11 +13,13 @@ WORK=$TARGETS/playground
...
@@ -13,11 +13,13 @@ WORK=$TARGETS/playground
INSTALL
=
$TARGETS
/install
INSTALL
=
$TARGETS
/install
LOCAL_PROJECTS
=
..
LOCAL_PROJECTS
=
..
OPENBIS_SERVER_NAME
=
openBIS-server
OPENBIS_SERVER
=
$WORK
/openBIS-server
OPENBIS_SERVER
=
$WORK
/
$OPENBIS_SERVER_NAME
ERR_LOG
=
$WORK
/all_err_log.txt
ERR_LOG
=
$WORK
/all_err_log.txt
SSH_CRUISE_CONTROL_NAME
=
ci@cisd-vesuvio.ethz.ch
CRUISE_CONTROL_ARTIFACTS
=
cruisecontrol-bin/artifacts
# ----------------------------- global state
# ----------------------------- global state
TEST_FAILED
=
false
# working variable, if true then some tests failed
TEST_FAILED
=
false
# working variable, if true then some tests failed
...
@@ -314,6 +316,16 @@ function build_zips_from_svn {
...
@@ -314,6 +316,16 @@ function build_zips_from_svn {
rm
-fr
$RSC
rm
-fr
$RSC
}
}
function
fetch_latest_artifacts_from_cruise_control
{
local
proj_name
=
$1
local
dest_dir
=
$2
local
list_cmd
=
"ls -1
$CRUISE_CONTROL_ARTIFACTS
/
$proj_name
| sort | tail -1"
local
last
=
`
echo
$list_cmd
| ssh
$SSH_CRUISE_CONTROL_NAME
-T
`
echo
"Fetching artifacts for
$proj_name
:
$last
"
scp
$SSH_CRUISE_CONTROL_NAME
:
$CRUISE_CONTROL_ARTIFACTS
/
$proj_name
/
$last
/
*
.zip
$dest_dir
}
# -------------------------- installation
# -------------------------- installation
# Recursively removes '.svn' directory in passed directory.
# Recursively removes '.svn' directory in passed directory.
...
@@ -367,36 +379,54 @@ function wait_for_server {
...
@@ -367,36 +379,54 @@ function wait_for_server {
fi
fi
}
}
function
install_openbis_server
{
function
restore_database
{
local
install_openbis
=
$1
local
db_name
=
$1
local
db_file_path
=
$2
psql_cmd
=
`
run_psql
`
psql_cmd
=
`
run_psql
`
$psql_cmd
-U
postgres
-c
"drop database
$DATABASE
"
$psql_cmd
-U
postgres
-c
"drop database
$db_name
"
$psql_cmd
-U
postgres
-c
"create database
$DATABASE
with owner
$USER
template = template0 encoding = 'UNICODE'"
$psql_cmd
-U
postgres
-c
"create database
$db_name
with owner
$USER
template = template0 encoding = 'UNICODE'"
$psql_cmd
-U
$USER
-d
$DATABASE
-f
$TEMPLATE
/
$OPENBIS_SERVER_NAME
/test_database.sql
$psql_cmd
-U
$USER
-d
$db_name
-f
$db_file_path
}
#
# Installs openbis server in the specified directory.
# Copies templates from the directory with the same name in $TEMPLATE diretcory.
#
function
install_openbis_server
{
local
install_openbis
=
$1
local
openbis_server_dir
=
$2
local
openbis_server_name
=
`
basename
$openbis_server_dir
`
restore_database
$DATABASE
$TEMPLATE
/
$openbis_server_name
/test_database.sql
if
[
$install_openbis
==
"true"
]
;
then
if
[
$install_openbis
==
"true"
]
;
then
rm
-fr
$
OPENBIS_SERVER
rm
-fr
$
openbis_server_dir
copy_templates
$
OPENBIS_SERVER_NAME
copy_templates
$
openbis_server_name
unzip
-d
$
OPENBIS_SERVER
$INSTALL
/openBIS
*
.zip
unzip
-d
$
openbis_server_dir
$INSTALL
/openBIS
*
.zip
$OPENBIS_SERVER
/openBIS-server/install.sh
$PWD
/
$
OPENBIS_SERVER
$OPENBIS_SERVER
/service.properties
$
OPENBIS_SERVER
/openbis.conf
$openbis_server_dir
/openBIS-server/install.sh
$PWD
/
$
openbis_server_dir
$openbis_server_dir
/service.properties
$
openbis_server_dir
/openbis.conf
startup_openbis_server
startup_openbis_server
$openbis_server_dir
wait_for_server
wait_for_server
else
else
copy_templates
$
OPENBIS_SERVER_NAME
copy_templates
$
openbis_server_name
restart_openbis
restart_openbis
$openbis_server_dir
fi
fi
}
}
function
startup_openbis_server
{
function
startup_openbis_server
{
call_in_dir bin/startup.sh
$OPENBIS_SERVER
/jetty
local
openbis_server_dir
=
$1
call_in_dir bin/startup.sh
$openbis_server_dir
/jetty
wait_for_server
wait_for_server
}
}
function
shutdown_openbis_server
{
function
shutdown_openbis_server
{
local
openbis_server_dir
=
$1
if
[
"
`
check_server_port
`
"
!=
""
]
;
then
if
[
"
`
check_server_port
`
"
!=
""
]
;
then
$
OPENBIS_SERVER
/jetty/bin/shutdown.sh
$
openbis_server_dir
/jetty/bin/shutdown.sh
fi
fi
}
}
...
@@ -434,17 +464,19 @@ function install_datamovers {
...
@@ -434,17 +464,19 @@ function install_datamovers {
}
}
function
restart_openbis
{
function
restart_openbis
{
assert_dir_exists_or_die
$OPENBIS_SERVER
local
openbis_server_dir
=
$1
assert_dir_exists_or_die
$openbis_server_dir
if
[
"
`
check_server_port
`
"
!=
""
]
;
then
if
[
"
`
check_server_port
`
"
!=
""
]
;
then
# maybe server is just closing, wait a moment
# maybe server is just closing, wait a moment
sleep
5
sleep
5
fi
fi
if
[
"
`
check_server_port
`
"
!=
""
]
;
then
if
[
"
`
check_server_port
`
"
!=
""
]
;
then
echo
Shutting down openbis server.
echo
Shutting down openbis server.
shutdown_openbis_server
shutdown_openbis_server
$openbis_server_dir
sleep
1
sleep
1
fi
fi
startup_openbis_server
startup_openbis_server
$openbis_server_dir
sleep
4
sleep
4
}
}
...
@@ -458,11 +490,11 @@ function install {
...
@@ -458,11 +490,11 @@ function install {
if
[
$reinstall_all
==
"true"
]
;
then
if
[
$reinstall_all
==
"true"
]
;
then
install_dsss
"true"
install_dsss
"true"
install_datamovers
"true"
install_datamovers
"true"
install_openbis_server
"true"
install_openbis_server
"true"
$OPENBIS_SERVER
else
else
install_dsss
$install_dss
install_dsss
$install_dss
install_datamovers
$install_dmv
install_datamovers
$install_dmv
install_openbis_server
$install_openbis
install_openbis_server
$install_openbis
$OPENBIS_SERVER
fi
fi
}
}
...
...
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