From d285cf2515dc1f65cae7c685f6da18351a0a5429 Mon Sep 17 00:00:00 2001 From: Frederic Marec Date: Wed, 27 Mar 2019 11:19:50 +0100 Subject: Add tests for xds-monitoring binding Change-Id: I31f47ae4b2d39d831d494e5f64415da151e76e1b Signed-off-by: Frederic Marec --- test/CMakeLists.txt | 27 +++++++++++++++++++ test/afb-test/CMakeLists.txt | 22 +++++++++++++++ test/afb-test/etc/CMakeLists.txt | 31 ++++++++++++++++++++++ test/afb-test/etc/aft-xds-monitoring-config.json | 22 +++++++++++++++ test/afb-test/tests/CMakeLists.txt | 31 ++++++++++++++++++++++ .../afb-test/tests/XDS-Monitoring_BasicAPITest.lua | 30 +++++++++++++++++++++ 6 files changed, 163 insertions(+) create mode 100644 test/CMakeLists.txt create mode 100644 test/afb-test/CMakeLists.txt create mode 100644 test/afb-test/etc/CMakeLists.txt create mode 100644 test/afb-test/etc/aft-xds-monitoring-config.json create mode 100644 test/afb-test/tests/CMakeLists.txt create mode 100644 test/afb-test/tests/XDS-Monitoring_BasicAPITest.lua diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..087abfd --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,27 @@ +########################################################################### +# Copyright 2015 - 2019 IoT.bzh +# +# author:Frédéric Marec +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + + +# Include any directory not starting with _ +# ----------------------------------------------------- +PROJECT_SUBDIRS_ADD(${PROJECT_SRC_DIR_PATTERN}) + +ADD_TEST(NAME XDS-MONITORING + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND afm-test ${CMAKE_BINARY_DIR}/package ${CMAKE_BINARY_DIR}/package-test +) \ No newline at end of file diff --git a/test/afb-test/CMakeLists.txt b/test/afb-test/CMakeLists.txt new file mode 100644 index 0000000..dbfd1cf --- /dev/null +++ b/test/afb-test/CMakeLists.txt @@ -0,0 +1,22 @@ +########################################################################### +# Copyright 2019 IoT.bzh +# +# author:Frédéric Marec +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + + +# Include any directory not starting with _ +# ----------------------------------------------------- +PROJECT_SUBDIRS_ADD(${PROJECT_SRC_DIR_PATTERN}) \ No newline at end of file diff --git a/test/afb-test/etc/CMakeLists.txt b/test/afb-test/etc/CMakeLists.txt new file mode 100644 index 0000000..687a866 --- /dev/null +++ b/test/afb-test/etc/CMakeLists.txt @@ -0,0 +1,31 @@ +########################################################################### +# Copyright 2019 IoT.bzh +# +# author:Frédéric Marec +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + +################################################## +# Audio XDS-Monitoring test configuration files +################################################## +PROJECT_TARGET_ADD(afb-test-config) + + file(GLOB CONF_FILES "*.json") + + add_input_files("${CONF_FILES}") + + SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES + LABELS "TEST-CONFIG" + OUTPUT_NAME ${TARGET_NAME} + ) \ No newline at end of file diff --git a/test/afb-test/etc/aft-xds-monitoring-config.json b/test/afb-test/etc/aft-xds-monitoring-config.json new file mode 100644 index 0000000..c604ece --- /dev/null +++ b/test/afb-test/etc/aft-xds-monitoring-config.json @@ -0,0 +1,22 @@ +{ + "id": "http://iot.bzh/download/public/schema/json/ctl-schema.json#", + "$schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json#", + "metadata": { + "uid": "Test", + "version": "1.0", + "api": "aft-xds-monitoring", + "info": "AFB-test binding configuration file to test XDS-Monitoring api.", + "require": [ + "xds" + ] + }, + "testVerb": { + "uid": "launch_all_tests", + "info": "Launch all the tests", + "action": "lua://AFT#_launch_test", + "args": { + "trace": "xds", + "files": ["XDS-Monitoring_BasicAPITest.lua"] + } + } +} \ No newline at end of file diff --git a/test/afb-test/tests/CMakeLists.txt b/test/afb-test/tests/CMakeLists.txt new file mode 100644 index 0000000..4dc9c2b --- /dev/null +++ b/test/afb-test/tests/CMakeLists.txt @@ -0,0 +1,31 @@ +########################################################################### +# Copyright 2019 IoT.bzh +# +# author:Frédéric Marec +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################### + + +################################################## +# Audio XDS-Monitoring Lua Scripts +################################################## +PROJECT_TARGET_ADD(test-files) + + file(GLOB LUA_FILES "*.lua") + add_input_files("${LUA_FILES}") + + SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES + LABELS "TEST-DATA" + OUTPUT_NAME ${TARGET_NAME} + ) \ No newline at end of file diff --git a/test/afb-test/tests/XDS-Monitoring_BasicAPITest.lua b/test/afb-test/tests/XDS-Monitoring_BasicAPITest.lua new file mode 100644 index 0000000..d2ed66a --- /dev/null +++ b/test/afb-test/tests/XDS-Monitoring_BasicAPITest.lua @@ -0,0 +1,30 @@ +--[[ + Copyright (C) 2019 "IoT.bzh" + Author Frédéric Marec + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + NOTE: strict mode: every global variables should be prefixed by '_' +--]] + +local testPrefix ="XDS-Monitoring_BasicAPITest_" + +-- This tests the 'ping' verb of the XDS-Monitoring API +_AFT.testVerbStatusSuccess(testPrefix.."ping","xds", "ping", {verbose = true}, nil, nil) + +-- This tests the 'auth' verb of the XDS-Monitoring API +_AFT.testVerbStatusSuccess(testPrefix.."auth","xds", "auth", {verbose = true}, nil, nil) + +-- This tests the 'wrong_verb' verb of the XDS-Monitoring API +_AFT.testVerbStatusError(testPrefix.."wrong_verb","xds", "wrong_verb", {verbose = true}, nil, nil) \ No newline at end of file -- cgit 1.2.3-korg