Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UPF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UPF
Commits
7a74b991
Commit
7a74b991
authored
Mar 31, 2021
by
foo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docker-compose mysql service updated
parent
56c460de
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
14 deletions
+71
-14
scripts/tests/docker-compose.yml
scripts/tests/docker-compose.yml
+23
-13
scripts/tests/mysql-healthcheck.sh
scripts/tests/mysql-healthcheck.sh
+46
-0
scripts/tests/oai_db.sql
scripts/tests/oai_db.sql
+2
-1
No files found.
scripts/tests/docker-compose.yml
View file @
7a74b991
...
@@ -2,19 +2,29 @@ version: '3.8'
...
@@ -2,19 +2,29 @@ version: '3.8'
services
:
services
:
mysql
:
mysql
:
image
:
mysql:latest
container_name
:
vpptest-mysql
container_name
:
mysql
image
:
mysql:5.7
volumes
:
-
./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
-
./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
environment
:
-
TZ=Europe/Paris
-
MYSQL_DATABASE=oai_db
-
MYSQL_USER=test
-
MYSQL_PASSWORD=test
-
MYSQL_ROOT_PASSWORD=linux
healthcheck
:
test
:
/bin/bash -c "/tmp/mysql-healthcheck.sh"
interval
:
10s
timeout
:
5s
retries
:
5
networks
:
networks
:
public_net
:
public_net
:
ipv4_address
:
192.168.74.200
ipv4_address
:
192.168.74.200
environment
:
MYSQL_ROOT_PASSWORD
:
'
linux'
volumes
:
-
./oai_db.sql:/oai_db.sql
oai-smf
:
oai-smf
:
image
:
oai-smf:vpp-upf
image
:
oai-smf:vpp-upf
container_name
:
oai-smf
container_name
:
vpptest-
oai-smf
privileged
:
true
privileged
:
true
networks
:
networks
:
public_net
:
public_net
:
...
@@ -53,7 +63,7 @@ services:
...
@@ -53,7 +63,7 @@ services:
oai-amf
:
oai-amf
:
image
:
oai-amf:develop
image
:
oai-amf:develop
container_name
:
oai-amf
container_name
:
vpptest-
oai-amf
privileged
:
true
privileged
:
true
networks
:
networks
:
public_net
:
public_net
:
...
@@ -110,7 +120,7 @@ services:
...
@@ -110,7 +120,7 @@ services:
oai-vpp
:
oai-vpp
:
image
:
vpp-upg:latest
image
:
vpp-upg:latest
privileged
:
true
privileged
:
true
container_name
:
oai-vpp-upf
container_name
:
vpptest-
oai-vpp-upf
networks
:
networks
:
public_net_access
:
public_net_access
:
ipv4_address
:
192.168.75.197
ipv4_address
:
192.168.75.197
...
@@ -172,7 +182,7 @@ services:
...
@@ -172,7 +182,7 @@ services:
oai-nat
:
oai-nat
:
image
:
ubuntu:bionic
image
:
ubuntu:bionic
privileged
:
true
privileged
:
true
container_name
:
oai-nat
container_name
:
vpptest-
oai-nat
networks
:
networks
:
public_net
:
public_net
:
ipv4_address
:
192.168.74.205
ipv4_address
:
192.168.74.205
...
@@ -187,7 +197,7 @@ services:
...
@@ -187,7 +197,7 @@ services:
gnbsim
:
gnbsim
:
image
:
gnbsim:latest
image
:
gnbsim:latest
privileged
:
true
privileged
:
true
container_name
:
gnbsim
container_name
:
vpptest-
gnbsim
environment
:
environment
:
MCC
:
208
MCC
:
208
MNC
:
95
MNC
:
95
...
@@ -216,7 +226,7 @@ services:
...
@@ -216,7 +226,7 @@ services:
public_net_access
:
public_net_access
:
ipv4_address
:
192.168.75.198
ipv4_address
:
192.168.75.198
volumes
:
volumes
:
-
./lib/modules/
5.8.0-43
-generic/kernel/drivers/net/gtp.ko:/lib/modules/5.8.0-43-generic/kernel/drivers/net/gtp.ko
-
./lib/modules/
4.15.0-76
-generic/kernel/drivers/net/gtp.ko:/lib/modules/5.8.0-43-generic/kernel/drivers/net/gtp.ko
networks
:
networks
:
public_net
:
public_net
:
...
...
scripts/tests/mysql-healthcheck.sh
0 → 100755
View file @
7a74b991
#!/bin/bash
set
-eo
pipefail
if
[
"
$MYSQL_ROOT_PASSWORD
"
]
&&
[
-z
"
$MYSQL_USER
"
]
&&
[
-z
"
$MYSQL_PASSWORD
"
]
;
then
echo
>
&2
'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)'
exit
0
fi
host
=
"
$(
hostname
--ip-address
||
echo
'127.0.0.1'
)
"
user
=
"
${
MYSQL_USER
:-
root
}
"
export
MYSQL_PWD
=
"
${
MYSQL_PASSWORD
:-
$MYSQL_ROOT_PASSWORD
}
"
args
=(
# force mysql to not use the local "mysqld.sock" (test "external" connectivity)
-h
"
$host
"
-u
"
$user
"
--silent
)
STATUS
=
0
if
command
-v
mysqladmin &> /dev/null
;
then
if
mysqladmin
"
${
args
[@]
}
"
ping
>
/dev/null
;
then
database_check
=
$(
mysql
-u
$user
-D
oai_db
--silent
-e
"SELECT * FROM users;"
)
if
[[
-z
$database_check
]]
;
then
echo
"Healthcheck error: oai_db not populated"
STATUS
=
1
fi
STATUS
=
0
else
echo
"Healthcheck error: Mysql port inactive"
STATUS
=
1
fi
else
if select
=
"
$(
echo
'SELECT 1'
| mysql
"
${
args
[@]
}
"
)
"
&&
[
"
$select
"
=
'1'
]
;
then
database_check
=
$(
mysql
-u
$user
-D
oai_db
--silent
-e
"SELECT * FROM users;"
)
if
[[
-z
$database_check
]]
;
then
echo
"Healthcheck error: oai_db not populated"
STATUS
=
1
fi
STATUS
=
0
else
echo
"Healthcheck error: Mysql port inactive"
STATUS
=
1
fi
fi
exit
$STATUS
scripts/tests/oai_db.sql
100644 → 100755
View file @
7a74b991
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment