Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MEC - Multi-access Edge Computing
MEC TTCN-3 Test Suite
Commits
f74ca589
Commit
f74ca589
authored
Jul 19, 2019
by
YannGarcia
Browse files
Merge branch 'master' of
https://forge.etsi.org/gitlab/mec/gs032p3-ttcn-test-suite
parents
6e22fab4
764363d4
Changes
6
Hide whitespace changes
Inline
Side-by-side
docker/build-container.sh
View file @
f74ca589
...
...
@@ -3,20 +3,25 @@
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -e
#
set -vx
set
-vx
DOCKER_FILE
=
./docker/Dockerfile
if
[
-f
${
DOCKER_FILE
}
]
then
docker
rm
--force
stf569_Mec
docker build
--tag
stf569_Mec
--force-rm
-f
${
DOCKER_FILE
}
.
#check and build stf569_mec image
DOCKER_ID
=
`
docker ps
-a
|
grep
-e
stf569_mec |
awk
'{ print $1 }'
`
if
[
!
-z
"
${
DOCKER_ID
}
"
]
then
docker
rm
--force
stf569_mec
fi
docker build
--tag
stf569_mec
--force-rm
-f
${
DOCKER_FILE
}
.
if
[
"
$?
"
!=
"0"
]
then
echo
"Docker build failed:
$?
"
exit
-1
fi
docker image
ls
-a
docker inspect stf569_
M
ec:latest
docker inspect stf569_
m
ec:latest
if
[
"
$?
"
!=
"0"
]
then
echo
"Docker inspect failed:
$?
"
...
...
docker/run-container.sh
View file @
f74ca589
...
...
@@ -5,9 +5,9 @@
#set -e
#set -vx
docker run stf569_
M
ec:latest
"/bin/bash"
\
docker run stf569_
m
ec:latest
"/bin/bash"
\
-c
"source /home/etsi/devenv.bash
\
&& cd /home/etsi/dev/etsi_
emcom
/src/AtsMec/objs
\
&& cd /home/etsi/dev/etsi_
mec
/src/AtsMec/objs
\
&& ../bin/run_all.bash
\
&& ls -ltr ../logs"
...
...
simu/data/ue_information_list.csv
View file @
f74ca589
appInst,ueTag,address,state
appInst01,UeTagA,acr:192.0.0.1,UNREGISTERED
appInst01,UeTagC,acr:192.0.0.3,
UNREGISTERED
appInst01,UeTagC,acr:192.0.0.3,
INVALID_STATE
appInst02,UeTagB,acr:192.0.0.2,UNREGISTERED
appInst03,UeTagD,acr:192.0.0.4,UNREGISTERED
appInst03,UeTagE,acr:192.0.0.5,UNREGISTERED
simu/mec_database.py
View file @
f74ca589
...
...
@@ -212,13 +212,15 @@ class mec_database:
def
registerUEidentity
(
self
,
p_app_inst
,
p_json_msg
):
print
(
">>> registerUEidentity"
,
p_json_msg
)
if
p_json_msg
[
"state"
]
!=
"REGISTERED"
and
p_json_msg
[
"state"
]
!=
"UNREGISTERED"
:
return
None
return
'400 Bad Request'
resp
=
None
try
:
# Check the record exists
r
=
tuple
(
self
.
__ue_information_list__
.
loc
[
p_app_inst
,
p_json_msg
[
"ueIdentityTag"
]])
print
(
"registerUEidentity: Find zoneId for appInst: "
,
p_app_inst
,
", r= "
,
r
)
self
.
__ue_information_list__
.
loc
[
p_app_inst
,
p_json_msg
[
"ueIdentityTag"
]][
'state'
]
=
p_json_msg
[
"state"
]
if
self
.
__ue_information_list__
.
loc
[
p_app_inst
,
p_json_msg
[
"ueIdentityTag"
]][
'state'
]
==
'INVALID_STATE'
:
return
'412 Precondition Failed'
self
.
__ue_information_list__
.
loc
[
p_app_inst
,
p_json_msg
[
"ueIdentityTag"
]][
'state'
]
=
p_json_msg
[
"state"
]
l
=
(
p_json_msg
[
"ueIdentityTag"
],
p_json_msg
[
"state"
])
resp
=
self
.
__to_ueIdentityTagInfo__
(
p_json_msg
[
"ueIdentityTag"
],
l
)
except
KeyError
:
...
...
simu/mec_http_server.py
View file @
f74ca589
...
...
@@ -96,12 +96,20 @@ class myHandler(http.server.BaseHTTPRequestHandler):
else
:
if
resp
.
find
(
'Not Found'
)
!=
-
1
:
self
.
send_response
(
404
,
'Not Found'
)
resp
=
""
elif
resp
.
find
(
'Forbidden'
)
!=
-
1
:
self
.
send_response
(
403
,
'Forbidden'
)
resp
=
""
elif
resp
.
find
(
'Bad Request'
)
!=
-
1
:
self
.
send_response
(
400
,
'Bad Request'
)
resp
=
""
elif
resp
.
find
(
'Precondition Failed'
)
!=
-
1
:
self
.
send_response
(
412
,
'Precondition Failed'
)
resp
=
"{
\"
problemDetails
\"
: {
\t\"
type
\"
:
\"
Precondition Failed
\"
,
\t\"
title
\"
:
\"
N/A
\"
,
\t\"
status
\"
: 412,
\t\"
detail
\"
:
\"
Wrong preconditions
\"
,
\t\"
instance
\"
:
\"
N/A
\"
}}"
content_type
=
'application/problem+json'
elif
resp
.
find
(
'userTrackingSubscription'
)
!=
-
1
:
self
.
send_response
(
201
,
'Created'
)
resp
=
""
else
:
self
.
send_response
(
200
,
'OK'
)
self
.
send_header
(
'Host'
,
self
.
headers
.
get
(
'Host'
))
# send_header() shall be after send_response()
...
...
simu/mec_simulator.py
View file @
f74ca589
...
...
@@ -8,9 +8,9 @@ import sys, os, time
import
msvcrt
# MEC simulator IPv4 address
#
ADDRESS_BINDING = '172.28.4.87'
ADDRESS_BINDING
=
'172.28.4.87'
#ADDRESS_BINDING = '192.168.1.21'
ADDRESS_BINDING
=
'192.168.0.17'
#
ADDRESS_BINDING = '192.168.0.17'
#ADDRESS_BINDING = '127.0.0.1'
# MEC simulator IPv4 listening port
PORT_NUMBER
=
8081
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment