Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
e3ac4d7b
Commit
e3ac4d7b
authored
10 years ago
by
Lukas Reschke
Browse files
Options
Downloads
Patches
Plain Diff
Lint bash script using ShellCheck
Ref
http://www.shellcheck.net/about.html
parent
e1923bac
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
autotest.sh
+11
-11
11 additions, 11 deletions
autotest.sh
with
11 additions
and
11 deletions
autotest.sh
+
11
−
11
View file @
e3ac4d7b
...
@@ -54,10 +54,10 @@ if ! [ -x "$PHPUNIT" ]; then
...
@@ -54,10 +54,10 @@ if ! [ -x "$PHPUNIT" ]; then
fi
fi
PHPUNIT_VERSION
=
$(
"
$PHP
"
"
$PHPUNIT
"
--version
|
cut
-d
" "
-f2
)
PHPUNIT_VERSION
=
$(
"
$PHP
"
"
$PHPUNIT
"
--version
|
cut
-d
" "
-f2
)
PHPUNIT_MAJOR_VERSION
=
$(
echo
$PHPUNIT_VERSION
|
cut
-d
"."
-f1
)
PHPUNIT_MAJOR_VERSION
=
$(
echo
"
$PHPUNIT_VERSION
"
|
cut
-d
"."
-f1
)
PHPUNIT_MINOR_VERSION
=
$(
echo
$PHPUNIT_VERSION
|
cut
-d
"."
-f2
)
PHPUNIT_MINOR_VERSION
=
$(
echo
"
$PHPUNIT_VERSION
"
|
cut
-d
"."
-f2
)
if
!
[
$PHPUNIT_MAJOR_VERSION
-gt
3
-o
\(
$PHPUNIT_MAJOR_VERSION
-eq
3
-a
$PHPUNIT_MINOR_VERSION
-ge
7
\)
]
;
then
if
!
[
"
$PHPUNIT_MAJOR_VERSION
"
-gt
3
-o
\(
"
$PHPUNIT_MAJOR_VERSION
"
-eq
3
-a
"
$PHPUNIT_MINOR_VERSION
"
-ge
7
\)
]
;
then
echo
"phpunit version >= 3.7 required. Version found:
$PHPUNIT_VERSION
"
>
&2
echo
"phpunit version >= 3.7 required. Version found:
$PHPUNIT_VERSION
"
>
&2
exit
4
exit
4
fi
fi
...
@@ -70,7 +70,7 @@ fi
...
@@ -70,7 +70,7 @@ fi
if
[
"
$1
"
]
;
then
if
[
"
$1
"
]
;
then
FOUND
=
0
FOUND
=
0
for
DBCONFIG
in
$DBCONFIGS
;
do
for
DBCONFIG
in
$DBCONFIGS
;
do
if
[
"
$1
"
=
$DBCONFIG
]
;
then
if
[
"
$1
"
=
"
$DBCONFIG
"
]
;
then
FOUND
=
1
FOUND
=
1
break
break
fi
fi
...
@@ -90,7 +90,7 @@ fi
...
@@ -90,7 +90,7 @@ fi
function
cleanup_config
{
function
cleanup_config
{
if
[
!
-z
"
$DOCKER_CONTAINER_ID
"
]
;
then
if
[
!
-z
"
$DOCKER_CONTAINER_ID
"
]
;
then
echo
"Kill the docker
$DOCKER_CONTAINER_ID
"
echo
"Kill the docker
$DOCKER_CONTAINER_ID
"
docker
rm
-f
$DOCKER_CONTAINER_ID
docker
rm
-f
"
$DOCKER_CONTAINER_ID
"
fi
fi
cd
"
$BASEDIR
"
cd
"
$BASEDIR
"
...
@@ -132,15 +132,15 @@ function execute_tests {
...
@@ -132,15 +132,15 @@ function execute_tests {
# drop database
# drop database
if
[
"
$1
"
==
"mysql"
]
;
then
if
[
"
$1
"
==
"mysql"
]
;
then
mysql
-u
$DATABASEUSER
-powncloud
-e
"DROP DATABASE IF EXISTS
$DATABASENAME
"
-h
$DATABASEHOST
||
true
mysql
-u
"
$DATABASEUSER
"
-powncloud
-e
"DROP DATABASE IF EXISTS
$DATABASENAME
"
-h
$DATABASEHOST
||
true
fi
fi
if
[
"
$1
"
==
"pgsql"
]
;
then
if
[
"
$1
"
==
"pgsql"
]
;
then
dropdb
-U
$DATABASEUSER
$DATABASENAME
||
true
dropdb
-U
"
$DATABASEUSER
"
"
$DATABASENAME
"
||
true
fi
fi
if
[
"
$1
"
==
"oci"
]
;
then
if
[
"
$1
"
==
"oci"
]
;
then
echo
"Fire up the oracle docker"
echo
"Fire up the oracle docker"
DOCKER_CONTAINER_ID
=
`
docker run
-d
deepdiver/docker-oracle-xe-11g
`
DOCKER_CONTAINER_ID
=
$(
docker run
-d
deepdiver/docker-oracle-xe-11g
)
DATABASEHOST
=
`
docker inspect
$DOCKER_CONTAINER_ID
|
grep
IPAddress |
cut
-d
'"'
-f
4
`
DATABASEHOST
=
$(
docker inspect
"
$DOCKER_CONTAINER_ID
"
|
grep
IPAddress |
cut
-d
'"'
-f
4
)
echo
"Waiting 60 seconds for Oracle initialization ... "
echo
"Waiting 60 seconds for Oracle initialization ... "
sleep
60
sleep
60
...
@@ -151,7 +151,7 @@ function execute_tests {
...
@@ -151,7 +151,7 @@ function execute_tests {
# trigger installation
# trigger installation
echo
"Installing ...."
echo
"Installing ...."
"
$PHP
"
./occ maintenance:install
--database
=
$1
--database-name
=
$DATABASENAME
--database-host
=
$DATABASEHOST
--database-user
=
$DATABASEUSER
--database-pass
=
owncloud
--database-table-prefix
=
oc_
--admin-user
=
$ADMINLOGIN
--admin-pass
=
admin
--data-dir
=
$DATADIR
"
$PHP
"
./occ maintenance:install
--database
=
"
$1
"
--database-name
=
"
$DATABASENAME
"
--database-host
=
"
$DATABASEHOST
"
--database-user
=
"
$DATABASEUSER
"
--database-pass
=
owncloud
--database-table-prefix
=
oc_
--admin-user
=
"
$ADMINLOGIN
"
--admin-pass
=
admin
--data-dir
=
"
$DATADIR
"
#test execution
#test execution
echo
"Testing with
$1
..."
echo
"Testing with
$1
..."
...
@@ -176,7 +176,7 @@ if [ -z "$1" ]
...
@@ -176,7 +176,7 @@ if [ -z "$1" ]
then
then
# run all known database configs
# run all known database configs
for
DBCONFIG
in
$DBCONFIGS
;
do
for
DBCONFIG
in
$DBCONFIGS
;
do
execute_tests
$DBCONFIG
execute_tests
"
$DBCONFIG
"
done
done
else
else
FILENAME
=
"
$2
"
FILENAME
=
"
$2
"
...
...
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