Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tst coverage #56

Merged
merged 52 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
10d8fe1
clean replace ip
MattiaMarzano-Eng Sep 22, 2021
3aa2ae6
update actions wf
MattiaMarzano-Eng Sep 22, 2021
112ca5a
update conf
MattiaMarzano-Eng Sep 22, 2021
9e72dd7
remove placeholder
MattiaMarzano-Eng Sep 22, 2021
2d1d1cc
url changed
MattiaMarzano-Eng Sep 23, 2021
f19b7aa
update properties
MattiaMarzano-Eng Sep 23, 2021
6dabffa
url update
MattiaMarzano-Eng Sep 23, 2021
1283009
indent prop
MattiaMarzano-Eng Sep 23, 2021
7925e12
update compose
MattiaMarzano-Eng Sep 23, 2021
2caa761
replace localhost with ip address
MattiaMarzano-Eng Sep 23, 2021
b57ba6f
sort tests
MattiaMarzano-Eng Sep 24, 2021
57bda53
cleaning tests
MattiaMarzano-Eng Sep 24, 2021
8eaf73b
new run age
MattiaMarzano-Eng Sep 24, 2021
b567f17
changed prop
MattiaMarzano-Eng Sep 24, 2021
730a80a
update set up
MattiaMarzano-Eng Sep 27, 2021
82f550d
skip tests
MattiaMarzano-Eng Sep 27, 2021
2dc920e
wf
MattiaMarzano-Eng Sep 27, 2021
6f6caa9
clean wf
MattiaMarzano-Eng Sep 27, 2021
f6a22b6
rollback wf
MattiaMarzano-Eng Sep 27, 2021
f090293
restore
MattiaMarzano-Eng Sep 27, 2021
969652e
fix
MattiaMarzano-Eng Sep 27, 2021
db764b5
fix compose
MattiaMarzano-Eng Sep 27, 2021
947e796
update test config
MattiaMarzano-Eng Sep 27, 2021
50aab25
update tests
MattiaMarzano-Eng Sep 28, 2021
2265286
run agent
MattiaMarzano-Eng Sep 29, 2021
08255ba
run agent in bg
MattiaMarzano-Eng Sep 29, 2021
61bd7db
update GA wf
MattiaMarzano-Eng Sep 29, 2021
e2c071b
async run
MattiaMarzano-Eng Sep 29, 2021
4ab4105
add tests
MattiaMarzano-Eng Sep 29, 2021
5c26f3e
enable test
MattiaMarzano-Eng Sep 29, 2021
7876bf0
rollback
MattiaMarzano-Eng Sep 29, 2021
415240a
refactoring tests
MattiaMarzano-Eng Sep 30, 2021
90af6eb
restore tests
MattiaMarzano-Eng Sep 30, 2021
21643e0
rollback
MattiaMarzano-Eng Sep 30, 2021
9450466
async delete
MattiaMarzano-Eng Sep 30, 2021
0d8c1cf
rollback
MattiaMarzano-Eng Sep 30, 2021
277bfba
restore to old version
MattiaMarzano-Eng Sep 30, 2021
3b3d573
rollback
MattiaMarzano-Eng Sep 30, 2021
7986a66
add test
MattiaMarzano-Eng Oct 4, 2021
e130554
fix add device
MattiaMarzano-Eng Oct 4, 2021
e225919
update delete
MattiaMarzano-Eng Oct 4, 2021
1470f46
update delete
MattiaMarzano-Eng Oct 4, 2021
e2d9099
enable unique subscription
MattiaMarzano-Eng Oct 4, 2021
7387f5c
enable polling
MattiaMarzano-Eng Oct 4, 2021
d86a0d5
disable polling
MattiaMarzano-Eng Oct 4, 2021
4dd8f3b
disable unique subscription
MattiaMarzano-Eng Oct 4, 2021
7bff26c
rollback
MattiaMarzano-Eng Oct 4, 2021
6d7bbe6
add logs
MattiaMarzano-Eng Oct 5, 2021
c49f728
indent
MattiaMarzano-Eng Oct 5, 2021
65f6c7e
sort tests
MattiaMarzano-Eng Oct 5, 2021
dc251e0
restore
MattiaMarzano-Eng Oct 5, 2021
58a8819
rollback GA wf
MattiaMarzano-Eng Oct 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conf/config.json.TEST_WITH_PLACEHOLDER
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"baseRoot": "/"
},
"deviceRegistry": {
"type": "memory"
"type": "mongodb"
},
"mongodb": {
"host": "TEST_MACHINE_IP",
"port": "27017",
"db": "iotagent",
"db": "iotagent_opcua",
"retries": 5,
"retryTime": 5
},
Expand Down
68 changes: 38 additions & 30 deletions conf/config.properties.WITH_PLACEHOLDER
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
## SOUTHBOUND CONFIGURATION (OPC UA)
namespace-ignore=2,7
endpoint=opc.tcp://TEST_MACHINE_IP:5001/UA/CarServer

namespaceIndex=3
namespaceNumericIdentifier=1000

## NORTHBOUND CONFIGURATION (ORION CONTEXT BROKER)
context-broker-host=TEST_MACHINE_IP
context-broker-port=1026
server-base-root=/
server-port=4001
device-registry-type=memory
mongodb-host=TEST_MACHINE_IP
mongodb-port=27017
mongodb-db=iotagent
mongodb-retries=5
mongodb-retry-time=5
fiware-service=opcua_car
fiware-service-path=/demo

## AGENT CONFIGURATION
server-base-root=
server-port=4001
provider-url=http://TEST_MACHINE_IP:4001

device-registration-duration=P1M
#endpoint=opc.tcp://TEST_MACHINE_IP:4334/UA/EnergyMESServer
endpoint=opc.tcp://TEST_MACHINE_IP:5001/UA/CarServer
device-registry-type=mongodb

log-level=INFO
#DATATYPE MAPPING OPCUA --> NGSI

namespaceIndex=3
namespaceNumericIdentifier=1000

# MONGO-DB CONFIGURATION (required if device-registry-type=mongodb)
mongodb-host=TEST_MACHINE_IP
mongodb-port=27017
mongodb-db=iotagent_opcua
mongodb-retries=5
mongodb-retry-time=5

## DATATYPE MAPPING OPCUA --> NGSI
OPC-datatype-Number=Number
OPC-datatype-Decimal128=Number
OPC-datatype-Double=Number
Expand All @@ -31,7 +39,7 @@ OPC-datatype-String=Text
OPC-datatype-ByteString=Text
#END DATATYPE MAPPING OPCUA --> NGSI

#SESSION PARAMETERS
## SESSION PARAMETERS
requestedPublishingInterval=10
requestedLifetimeCount=1000
requestedMaxKeepAliveCount=10
Expand All @@ -40,43 +48,43 @@ publishingEnabled=true
priority=10

#SubscriptionsStrategy
uniqueSubscription=false
uniqueSubscription=true

#MONITORING PARAMETERS
## MONITORING PARAMETERS
samplingInterval=1
queueSize=10000
discardOldest=false

#SERVER CERT E AUTH
## SERVER CERT E AUTH
securityMode=None
securityPolicy=None
userName=
password=

#securityMode=SIGNANDENCRYPT
#securityPolicy=Basic256
#securityPolicy=1Basic256
#password=password1
#userName=user1

#api-ip=192.168.13.153

#Administration Services
## ADMINISTRATION SERVICES
api-port=8080
#End Administration Services

#POLL COMMANDS SETTINGS
polling=true
## POLL COMMANDS SETTINGS
polling=false
polling-commands-timer=1000
pollingDaemonFrequency=20000
pollingExpiration=200000
#END POLL COMMANDS SETTINGS

#AGENT ID
## AGENT ID
agent-id=age01_

entity-id=age01_Car
test-machine-ip=TEST_MACHINE_IP
#CONFIGURATION
configuration=api
#CHECK TIMER POLLING DEVICES

## CONFIGURATION
configuration=#api

## CHECK TIMER POLLING DEVICES
checkTimer=2000
4 changes: 1 addition & 3 deletions replace_local_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
MACHINE_IP=$(hostname -I | cut -d ' ' -f 1)

sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.properties
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.json
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.properties.WITH_PLACEHOLDER
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.json.TEST_WITH_PLACEHOLDER
sed -i "s/TEST_MACHINE_IP/$MACHINE_IP/g" conf/config.json
65 changes: 14 additions & 51 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,38 @@
version: "3"
#secrets:
# age_idm_auth:
# file: age_idm_auth.txt
version: "3.2"

services:
iotcarsrv:
hostname: iotcarsrv
image: iotagent4fiware/opcuacarsrv:latest
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
networks:
- hostnet
ports:
- "5001:5001"

iotmongo:
hostname: iotmongo
mongo-db:
image: mongo:4.2
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
networks:
- iotnet
hostname: mongo-db
ports:
- "27017:27017"
networks:
- hostnet
volumes:
- iot_mongo_data:/data/db
- iot_mongo_conf:/data/configdb

################ OCB ################
- mongo-db:/data

orion:
hostname: orion
image: fiware/orion:latest
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
hostname: orion
container_name: fiware-orion
depends_on:
- mongo-db
networks:
- hostnet
- ocbnet
ports:
- "1026:1026"
depends_on:
- orion_mongo
command: -statCounters -dbhost orion_mongo -logLevel INFO

orion_mongo:
hostname: orion_mongo
image: mongo:4.2
environment:
- http_proxy=$http_proxy
- https_proxy=$https_proxy
- no_proxy=$no_proxy
networks:
- ocbnet
volumes:
- orion_mongo_data:/data/db
- orion_mongo_conf:/data/configdb
command: --nojournal

volumes:
iot_mongo_data:
iot_mongo_conf:
orion_mongo_data:
orion_mongo_conf:
command: -dbhost mongo-db -logLevel DEBUG

networks:
hostnet:
iotnet:
ocbnet:

volumes:
mongo-db:
Loading