From 1a603ed3393d7172bf24d7c2f1123ba6cbe18725 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 18 Jun 2024 13:56:01 +0200 Subject: [PATCH 01/20] Update ATS submodules; Add TTCN-3 skeletons --- .gitmodules | 4 +++ README.md | 95 +++-------------------------------------------------- lib/asn1 | 1 + 3 files changed, 10 insertions(+), 90 deletions(-) create mode 100644 .gitmodules create mode 160000 lib/asn1 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..138580e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "lib/asn1"] + path = lib/asn1 + url = https://forge.etsi.org/rep/ITS/asn1/vam-ts103300_3.git + branch = TTF_T036 diff --git a/README.md b/README.md index 487448c..a7ba876 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,7 @@ -# VRU TS 104 018-3 +# Cooperative Awareness Message TTCN-3 test suite +Cooperative Awareness Message abstract test suite (ATS) as defined in [ETSI TS 102 868-3 v1.5.1](https://www.etsi.org/deliver/etsi_ts/102800_102899/10286803/01.05.01_60/ts_10286803v010501p.pdf) - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://forge.etsi.org/rep/ITS/ttcn/vru-ts-104-018-3.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://forge.etsi.org/rep/ITS/ttcn/vru-ts-104-018-3/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +This code is a part of the ETSI ITS test suite, available on https://forge.etsi.org/rep/ITS/TS.ITS and cannot be run independently. +Please clone the main ETSI ITS test suite repository and compile and follow the compilation instructions. +To run this code, the test suite shall be compiled using `make ATS=AtsCAM` diff --git a/lib/asn1 b/lib/asn1 new file mode 160000 index 0000000..a8a6d95 --- /dev/null +++ b/lib/asn1 @@ -0,0 +1 @@ +Subproject commit a8a6d958b04a25b9fee9f69c609ce77dcc60cf58 -- GitLab From 2b9675deb52e4eefb9858364fef66bf95cda4976 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 18 Jun 2024 13:56:20 +0200 Subject: [PATCH 02/20] Update ATS submodules; Add TTCN-3 skeletons --- ItsVru_TestCases.ttcn | 3 ++ ItsVru_TestControl.ttcn | 3 ++ ItsVru_TpFunctions.ttcn | 3 ++ LICENSE | 23 ++++++++++++ lib/LibItsVru_EncdecDeclarations.ttcn | 3 ++ lib/LibItsVru_Pics.ttcn | 3 ++ lib/LibItsVru_Pixits.ttcn | 3 ++ lib/LibItsVru_Templates.ttcn | 3 ++ lib/LibItsVru_TypesAndValues.ttcn | 3 ++ lib/module.mk | 9 +++++ lib_system/LibItsVru_Functions.ttcn | 3 ++ lib_system/LibItsVru_TestSystem.ttcn | 3 ++ lib_system/module.mk | 1 + module.mk | 51 +++++++++++++++++++++++++++ 14 files changed, 114 insertions(+) create mode 100644 ItsVru_TestCases.ttcn create mode 100644 ItsVru_TestControl.ttcn create mode 100644 ItsVru_TpFunctions.ttcn create mode 100644 LICENSE create mode 100644 lib/LibItsVru_EncdecDeclarations.ttcn create mode 100644 lib/LibItsVru_Pics.ttcn create mode 100644 lib/LibItsVru_Pixits.ttcn create mode 100644 lib/LibItsVru_Templates.ttcn create mode 100644 lib/LibItsVru_TypesAndValues.ttcn create mode 100644 lib/module.mk create mode 100644 lib_system/LibItsVru_Functions.ttcn create mode 100644 lib_system/LibItsVru_TestSystem.ttcn create mode 100644 lib_system/module.mk create mode 100644 module.mk diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn new file mode 100644 index 0000000..cd3e38b --- /dev/null +++ b/ItsVru_TestCases.ttcn @@ -0,0 +1,3 @@ +module ItsVru_TestCases { + +} // End of module ItsVru_TestCases \ No newline at end of file diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn new file mode 100644 index 0000000..d5088b3 --- /dev/null +++ b/ItsVru_TestControl.ttcn @@ -0,0 +1,3 @@ +module ItsVru_TestControl { + +} // End of module ItsVru_TestControl \ No newline at end of file diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn new file mode 100644 index 0000000..bf2d31f --- /dev/null +++ b/ItsVru_TpFunctions.ttcn @@ -0,0 +1,3 @@ +module ItsVru_TpFunctions { + +} // End of module ItsVru_TpFunctions \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..87e45c5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Copyright 2022 ETSI + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/lib/LibItsVru_EncdecDeclarations.ttcn b/lib/LibItsVru_EncdecDeclarations.ttcn new file mode 100644 index 0000000..e4fa9f9 --- /dev/null +++ b/lib/LibItsVru_EncdecDeclarations.ttcn @@ -0,0 +1,3 @@ +module LibItsVru_EncdecDeclarations { + +} // End of module LibItsVru_EncdecDeclarations \ No newline at end of file diff --git a/lib/LibItsVru_Pics.ttcn b/lib/LibItsVru_Pics.ttcn new file mode 100644 index 0000000..57e3705 --- /dev/null +++ b/lib/LibItsVru_Pics.ttcn @@ -0,0 +1,3 @@ +module LibItsVru_Pics { + +} // End of module LibItsVru_Pics \ No newline at end of file diff --git a/lib/LibItsVru_Pixits.ttcn b/lib/LibItsVru_Pixits.ttcn new file mode 100644 index 0000000..f056b5b --- /dev/null +++ b/lib/LibItsVru_Pixits.ttcn @@ -0,0 +1,3 @@ +module LibItsVru_Pixits { + +} // End of module LibItsVru_Pixits \ No newline at end of file diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn new file mode 100644 index 0000000..4fe13ef --- /dev/null +++ b/lib/LibItsVru_Templates.ttcn @@ -0,0 +1,3 @@ +module LibItsVru_Templates { + +} // End of module LibItsVru_Templates \ No newline at end of file diff --git a/lib/LibItsVru_TypesAndValues.ttcn b/lib/LibItsVru_TypesAndValues.ttcn new file mode 100644 index 0000000..9c05dab --- /dev/null +++ b/lib/LibItsVru_TypesAndValues.ttcn @@ -0,0 +1,3 @@ +module LibItsVru_TypesAndValues { + +} // End of module LibItsVru_TypesAndValues \ No newline at end of file diff --git a/lib/module.mk b/lib/module.mk new file mode 100644 index 0000000..3f7abad --- /dev/null +++ b/lib/module.mk @@ -0,0 +1,9 @@ +sources := \ + LibItsVru_EncdecDeclarations.ttcn \ + LibItsVru_Pics.ttcn \ + LibItsVru_Pixits.ttcn \ + LibItsVru_Templates.ttcn \ + LibItsVru_TypesAndValues.ttcn \ + + +modules := asn1 diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn new file mode 100644 index 0000000..f1519b4 --- /dev/null +++ b/lib_system/LibItsVru_Functions.ttcn @@ -0,0 +1,3 @@ +module LibItsVru_Functions { + +} // End of module LibItsVru_Functions \ No newline at end of file diff --git a/lib_system/LibItsVru_TestSystem.ttcn b/lib_system/LibItsVru_TestSystem.ttcn new file mode 100644 index 0000000..d53cad0 --- /dev/null +++ b/lib_system/LibItsVru_TestSystem.ttcn @@ -0,0 +1,3 @@ +module LibItsVru_TestSystem { + +} // End of module LibItsVru_TestSystem \ No newline at end of file diff --git a/lib_system/module.mk b/lib_system/module.mk new file mode 100644 index 0000000..04732d3 --- /dev/null +++ b/lib_system/module.mk @@ -0,0 +1 @@ +sources := LibItsVru_Functions.ttcn LibItsVru_TestSystem.ttcn diff --git a/module.mk b/module.mk new file mode 100644 index 0000000..c80f880 --- /dev/null +++ b/module.mk @@ -0,0 +1,51 @@ +suite := AtsVRU +pdu := CollectivePerceptionMessage + +sources := ItsVru_TestCases.ttcn \ + ItsVru_TestControl.ttcn \ + ItsVru_TpFunctions.ttcn \ + +modules := lib \ + lib_system \ + ../../titan-test-system-framework/ttcn/LibHelpers \ + ../../titan-test-system-framework/ttcn/LibSecurity \ + ../../titan-test-system-framework/ttcn/LibXsd \ + ../LibCommon \ + ../LibIts \ + ../AtsGeoNetworking/lib \ + ../AtsGeoNetworking/lib_system \ + ../AtsIPv6OverGeoNetworking/lib \ + ../AtsIPv6OverGeoNetworking/lib_system \ + ../AtsSecurity/lib \ + ../AtsSecurity/lib_system \ + ../AtsBTP/lib \ + ../AtsBTP/lib_system \ + /ccsrc/Ports/LibIts_ports \ + /ccsrc/Ports/LibIts_ports/VRU_ports \ + /ccsrc/Ports/LibIts_ports/GN_ports \ + /ccsrc/Ports/LibIts_ports/IPv6oGN_ports \ + /ccsrc/Ports/LibIts_ports/BTP_ports \ + /ccsrc/EncDec \ + /titan-test-system-framework/ccsrc/Framework \ + /titan-test-system-framework/ccsrc/loggers \ + /titan-test-system-framework/ccsrc/Protocols/ETH \ + /titan-test-system-framework/ccsrc/Protocols/Tcp \ + /titan-test-system-framework/ccsrc/Protocols/Pcap \ + /titan-test-system-framework/ccsrc/Protocols/Xml \ + /titan-test-system-framework/ccsrc/Helpers \ + /titan-test-system-framework/ccsrc/security \ + /ccsrc/Externals \ + /ccsrc/geospacial \ + /ccsrc/Asn1c \ + /ccsrc/framework \ + /ccsrc/Protocols/VRU \ + /ccsrc/Protocols/VRU_layers \ + /ccsrc/Protocols/GeoNetworking \ + /ccsrc/Protocols/BTP \ + /ccsrc/Protocols/BTP_layers \ + /ccsrc/Protocols/LTE \ + /ccsrc/Protocols/Qualcomm \ + /ccsrc/Protocols/UpperTester \ + /ccsrc/Protocols/Security \ + ../modules/titan.TestPorts.Common_Components.Abstract_Socket \ + -- GitLab From 151fa8d5962a2b3164a79ba52e7745212c201293 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 18 Jun 2024 14:03:21 +0200 Subject: [PATCH 03/20] Update module.mk --- lib/asn1 | 2 +- module.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/asn1 b/lib/asn1 index a8a6d95..ba4abd3 160000 --- a/lib/asn1 +++ b/lib/asn1 @@ -1 +1 @@ -Subproject commit a8a6d958b04a25b9fee9f69c609ce77dcc60cf58 +Subproject commit ba4abd3cd9841460a6dad8f2a5cb45f495832efd diff --git a/module.mk b/module.mk index c80f880..e94440b 100644 --- a/module.mk +++ b/module.mk @@ -1,5 +1,5 @@ suite := AtsVRU -pdu := CollectivePerceptionMessage +pdu := VAM sources := ItsVru_TestCases.ttcn \ ItsVru_TestControl.ttcn \ -- GitLab From 9c9a94a354bdf000fbd4e81608c54d5f3a00b414 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 20 Jun 2024 14:43:52 +0200 Subject: [PATCH 04/20] Add basics TTCN-3 functionalities --- ItsVru_TestCases.ttcn | 100 +++++++ ItsVru_TestControl.ttcn | 17 ++ ItsVru_TpFunctions.ttcn | 192 +++++++++++++ lib/LibItsVru_EncdecDeclarations.ttcn | 27 ++ lib/LibItsVru_Pics.ttcn | 21 ++ lib/LibItsVru_Templates.ttcn | 133 +++++++++ lib/LibItsVru_TypesAndValues.ttcn | 93 ++++++- lib/asn1 | 2 +- lib_system/LibItsVru_Functions.ttcn | 376 ++++++++++++++++++++++++++ lib_system/LibItsVru_TestSystem.ttcn | 100 ++++++- 10 files changed, 1058 insertions(+), 3 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index cd3e38b..a7a9515 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -1,3 +1,103 @@ module ItsVru_TestCases { + // LibItsVru + import from LibItsVru_TestSystem all; + + // Ats Its + import from ItsVru_TpFunctions all; + + group vruLowerLayerParameters { + + /** + * @desc Check that VAM is encapsulated in BTP type B packet + *
+    * Pics Selection: PICS_VRU_GENERATION AND NOT PICS_IS_IUT_SECURED
+    * Initial conditions: 
+    *     with {
+    *         the IUT being in the "initial state"
+    *     }
+    * Expected behaviour:
+    *  ensure that {
+    *      when {
+    *          a CollectivePerceptionMessage is generated
+    *      }
+    *      then {
+    *          the IUT sends a CollectivePerceptionMessage
+    *              encapsulated in a BTP-B packet
+    *      }
+    *  } 
+    * 
+ * + * @see ETSI TS 104 018-2 v1.5.1 TP/VRU/MSD/PAR/BV-01 + * @reference ETSI EN 302 637-2 v1.4.1, clause 5.3.4.1 + */ + testcase TC_VRU_MSD_PAR_BV_01() runs on ItsVru system ItsVruSystem { + + f_VRU_MSD_PAR_BV_01(); + + } // End of TC_VRU_MSD_PAR_BV_01 + + /** + * @desc Check that VAM is encapsulated in SHB packet + *
+    * Pics Selection: PICS_VRU_GENERATION AND NOT PICS_IS_IUT_SECURED
+    * Initial conditions: 
+    *     with {
+    *         the IUT being in the "initial state"
+    *     }
+    * Expected behaviour:
+    *  ensure that {
+    *      when {
+    *          a CollectivePerceptionMessage is generated
+    *      }
+    *      then {
+    *          the IUT sends a CollectivePerceptionMessage
+    *              encapsulated in a SHB packet
+    *      }
+    *  } 
+    * 
+ * + * @see ETSI TS 104 018-2 v1.5.1 TP/VRU/MSD/PAR/BV-02 + * @reference ETSI EN 302 637-2 v1.4.1, clause 5.3.4.1 + */ + testcase TC_VRU_MSD_PAR_BV_02() runs on ItsVru system ItsVruSystem { + + f_VRU_MSD_PAR_BV_02(); + + } // End of TC_VRU_MSD_PAR_BV_02 + + /** + * @desc Check that VRU is encapsulated in GN packet with lifetime lower than 1s + *
+    * Pics Selection: PICS_VRU_GENERATION AND NOT PICS_IS_IUT_SECURED
+    * Initial conditions: 
+    *     with {
+    *         the IUT being in the "initial state"
+    *     }
+    * Expected behaviour:
+    *  ensure that {
+    *      when {
+    *          a CollectivePerceptionMessage is generated
+    *      }
+    *      then {
+    *          the IUT sends a VAM
+    *              encapsulated in a GN packet
+    *                  containing Basic Header
+    *                      containing Lifetime field 
+    *                          indicating value lower than 1s
+    *      }
+    *  } 
+    * 
+ * + * @see ETSI TS 104 018-2 v1.5.1 TP/VRU/MSD/PAR/BV-03 + * @reference ETSI EN 302 637-2 v1.4.1, clause 5.3.4.1 + */ + testcase TC_VRU_MSD_PAR_BV_03() runs on ItsVru system ItsVruSystem { + + f_VRU_MSD_PAR_BV_03(); + + } // End of TC_VRU_MSD_PAR_BV_03 + + } // End of vruLowerLayerParameters + } // End of module ItsVru_TestCases \ No newline at end of file diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn index d5088b3..b57d652 100644 --- a/ItsVru_TestControl.ttcn +++ b/ItsVru_TestControl.ttcn @@ -1,3 +1,20 @@ module ItsVru_TestControl { + // ATS VRU + import from ItsVru_TestCases all; + + // LibIts + import from LibItsVru_Pics all; + + // Test Execution + control { + + if(PICS_VRU_GENERATION) { + execute(TC_VRU_MSD_PAR_BV_01()); + execute(TC_VRU_MSD_PAR_BV_02()); + execute(TC_VRU_MSD_PAR_BV_03()); + } + + } + } // End of module ItsVru_TestControl \ No newline at end of file diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index bf2d31f..35a2fd4 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -1,3 +1,195 @@ module ItsVru_TpFunctions { + // LibCommon + import from LibCommon_Sync all; + import from LibCommon_VerdictControl all; + import from LibCommon_Time all; + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from ETSI_ITS_CDD language "ASN.1:1997" all; + import from VAM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_Functions all; + import from LibItsCommon_Pixits all; + import from LibItsCommon_ASN1_NamedNumbers all; + + // LibItsVru + import from LibItsVru_TestSystem all; + import from LibItsVru_Functions all; + import from LibItsVru_Templates all; + import from LibItsVru_TypesAndValues all; + import from LibItsVru_Pics all; + + import from LibItsSecurity_Functions all; + group vruLowerLayerParameters { + + /** + * @desc TP Function for TC_VRU_MSD_PAR_BV_01 + */ + function f_VRU_MSD_PAR_BV_01() runs on ItsVru { + + // Local variables + const UInt8 c_gnNhBtpB := 2; + + // Test control + if (not PICS_VRU_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VRU_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, c_gnNhBtpB)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Expected VRU message encapsultated in BTP-B packet received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, omit)) { + tc_ac.stop; + log("*** " & testcasename() & ": INCONC: no GN NH information in CpmInd ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in BTP-B packet ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_VRU_MSD_PAR_BV_01 + + /** + * @desc TP Function for TC_VRU_MSD_PAR_BV_02 + */ + function f_VRU_MSD_PAR_BV_02() runs on ItsVru { + + // Local variables + const UInt8 c_gnHtTsb := 5; + const UInt8 c_GnHstSingleHop := 0; + + // Test control + if (not PICS_VRU_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VRU_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, c_gnHtTsb, c_GnHstSingleHop)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Expected VRU message encapsulated in SHB packet received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, omit, omit)) { + tc_ac.stop; + log("*** " & testcasename() & ": INCONC: no GN HT/HST information in CpmInd ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in SHB packet ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_VRU_MSD_PAR_BV_02 + + /** + * @desc TP Function for TC_VRU_MSD_PAR_BV_03 + */ + function f_VRU_MSD_PAR_BV_03() runs on ItsVru { + + // Local variables + var VamInd v_vamInd; + + // Test control + if (not PICS_VRU_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VRU_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any)) -> value v_vamInd { + tc_ac.stop; + if(not ispresent(v_vamInd.gnLifetime)) { + log("*** " & testcasename() & ": INCONC: no GN lifetime information in CpmInd ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + if(v_vamInd.gnLifetime <= 1000) { + log("*** " & testcasename() & ": PASS: Expected VRU message received encapsulted in GN packet with correct lifetime value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + else { + log("*** " & testcasename() & ": FAIL: Expected VRU message received encapsulted in GN packet with incorrect lifetime value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_VRU_MSD_PAR_BV_03 + + } // End of group vruLowerLayerParameters + } // End of module ItsVru_TpFunctions \ No newline at end of file diff --git a/lib/LibItsVru_EncdecDeclarations.ttcn b/lib/LibItsVru_EncdecDeclarations.ttcn index e4fa9f9..a60a208 100644 --- a/lib/LibItsVru_EncdecDeclarations.ttcn +++ b/lib/LibItsVru_EncdecDeclarations.ttcn @@ -1,3 +1,30 @@ module LibItsVru_EncdecDeclarations { + // LibIts + import from VAM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsVru + import from LibItsVru_TypesAndValues all; + + external function fx_enc_VruReq (VamReq p) return bitstring + with {extension "prototype(convert) encode(LibIts_Interface)"} + + external function fx_dec_VruReq (inout bitstring b, out VamReq p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_dec_VruInd (inout bitstring b, out VamInd p) return integer + with {extension "prototype(sliding) decode(LibIts_Interface)"} + + external function fx_enc_VAM (VAM p) return bitstring + with {extension "prototype(convert) encode(PER)"} + + external function fx_dec_VAM (inout bitstring b, out VAM p) return integer + with {extension "prototype(sliding) decode(PER)"} + + external function fx_enc_UtVruInitialize (UtVruInitialize p) return bitstring + with {extension "prototype(convert) encode(UpperTester)"} + + external function fx_dec_UtVruEventInd (inout bitstring b, out UtVruEventInd p) return integer + with {extension "prototype(sliding) decode(UpperTester)"} + } // End of module LibItsVru_EncdecDeclarations \ No newline at end of file diff --git a/lib/LibItsVru_Pics.ttcn b/lib/LibItsVru_Pics.ttcn index 57e3705..6cff8e9 100644 --- a/lib/LibItsVru_Pics.ttcn +++ b/lib/LibItsVru_Pics.ttcn @@ -1,3 +1,24 @@ module LibItsVru_Pics { + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + /** + * @desc Is the IUT running in secured mode? + * @see ETSI TS 104 019-1 Table A.1 + */ + modulepar boolean PICS_IS_IUT_SECURED := false; + + /** + * @desc Support for VRU generation + * @see ETSI TS 104 019-1 Table A.3 + */ + modulepar boolean PICS_VRU_GENERATION := true; + + /** + * @desc Support for VRU reception + * @see ETSI TS 104 019-1 Table A.3 + */ + modulepar boolean PICS_VRU_RECEPTION := true; + } // End of module LibItsVru_Pics \ No newline at end of file diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn index 4fe13ef..74f8ad1 100644 --- a/lib/LibItsVru_Templates.ttcn +++ b/lib/LibItsVru_Templates.ttcn @@ -1,3 +1,136 @@ module LibItsVru_Templates { + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibHelpers + import from LibHelpers_Functions all; + + // LibIts + import from ETSI_ITS_CDD language "ASN.1:1997" all; + import from VAM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_Functions all; + import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_ASN1_NamedNumbers all; + + // LibItsVru + import from LibItsVru_TypesAndValues all; + + group vruPrimitives { + + /** + * @desc Receive template for VRU Message (VamPort Primitive) + * @param p_vruMsg Expected VRU Message + */ + template VamInd mw_vamInd ( + in template (present) VAM p_vruMsg + ) := { + msgIn := p_vruMsg, + recvTime := ?, + gnNextHeader := *, + gnHeaderType := *, + gnHeaderSubtype := *, + gnLifetime := *, + gnTrafficClass := *, + btpDestinationPort := *, + btpInfo := *, + ssp := *, + its_aid := * + } // End of template mw_vamInd + + /** + * @desc Receive template for VRU Message (VamPort Primitive) + * @param p_vruMsg Expected VRU Message + * @param p_gnNextHeader GN next header value + * @param p_gnHeaderType GN header type value + * @param p_gnHeaderSubtype GN header subtype value + * @param p_gnLifetime GN packet lifetime value (ms) + * @param p_gnTrafficClass GN traffic class value + */ + template VamInd mw_vamIndWithGnParameters ( + in template (present) VAM p_vruMsg, + in template UInt8 p_gnNextHeader := *, + in template UInt8 p_gnHeaderType := *, + in template UInt8 p_gnHeaderSubtype := *, + in template UInt32 p_gnLifetime := *, + in template UInt8 p_gnTrafficClass := * + ) modifies mw_vamInd := { + gnNextHeader := p_gnNextHeader, + gnHeaderType := p_gnHeaderType, + gnHeaderSubtype := p_gnHeaderSubtype, + gnLifetime := p_gnLifetime, + gnTrafficClass := p_gnTrafficClass + } // End of template mw_vamIndWithGnParameters + + /** + * @desc Receive template for CA Message (DenmPort Primitive) + * @param p_caMsg The expected CA Message + * @param p_ssp SSP security parameter + * @param p_its_aid ITS-AID value + */ + template VamInd mw_vamIndWithSecurityParameters( + template (present) VAM p_vruMsg, + template Bit256 p_ssp := *, + template UInt32 p_its_aid := c_its_aid_CAM + ) modifies mw_vamInd := { + ssp := p_ssp, + its_aid := p_its_aid + } // End of template mw_vamIndWithSecurityParameters + + /** + * @desc Receive template for VRU Message (VamPort Primitive) + * @param p_vruMsg Expected VRU Message + * @param p_btpDestinationPort BTP destination port value + * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) + */ + template VamInd mw_vamIndWithBtpParameters( + in template (present) VAM p_vruMsg, + in template UInt16 p_btpDestinationPort := *, + in template UInt16 p_btpInfo := * + ) modifies mw_vamInd := { + btpDestinationPort := p_btpDestinationPort, + btpInfo := p_btpInfo + } // End of template mw_vamIndWithBtpParameters + + /** + * @desc Send template for VRU Message (VamPort Primitive) + * @param p_vruMsg VRU Message to be received + */ + template (value) VamReq m_vruReq( + in template (value) VAM p_vruMsg + ) := { + msgOut := p_vruMsg + } // End of template m_vruReq + + group vruUtPrimitives { + + /** + * @desc Initializes the VRU IUT. + */ + template (value) UtVruInitialize m_vruInitialize := { + hashedId8 := '0000000000000000'O + } + + } // End of group utPrimitives + + } // End of group Primitives + + /** + * @desc Default Receive template for VAM PDU + */ + template (present) VAM mw_vamMsg_any := { + header := { + protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + messageId := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageId_vru_, + stationId := ? + }, + vam := { + generationDeltaTime := ?, + vamParameters := ? + } + } + } // End of module LibItsVru_Templates \ No newline at end of file diff --git a/lib/LibItsVru_TypesAndValues.ttcn b/lib/LibItsVru_TypesAndValues.ttcn index 9c05dab..f44dc49 100644 --- a/lib/LibItsVru_TypesAndValues.ttcn +++ b/lib/LibItsVru_TypesAndValues.ttcn @@ -1,3 +1,94 @@ module LibItsVru_TypesAndValues { -} // End of module LibItsVru_TypesAndValues \ No newline at end of file + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from ETSI_ITS_CDD language "ASN.1:1997" all; + import from VAM_PDU_Descriptions language "ASN.1:1997" all; + + group utPrimitives { + + /** + * @desc Upper Tester message to initialize IUT + * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use + */ + type record UtVruInitialize { + Oct8 hashedId8 + } with { + variant "FIELDORDER(msb)" + } + + /** + * @desc Upper Tester results message of the VRU IUT + */ + type union UtVruResults { + boolean utVruInitializeResult + } with { + variant "" + } // End of type UtVruResults + + /** + * @desc Upper Tester message to check event/status on VRU IUT + */ + type record UtVruEventInd { + VAM vamMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd + } with { + encode (vamMsg) "LibItsVru_asn1" + } + + /** + * @desc List of Upper Tester messages to check event/status on VRU IUT + */ + type record of UtVruEventInd UtVruEventIndList; + + } with { + encode "UpperTester" + variant "" + } // End of group utPrimitives + + group facilityPrimitives { + + group fa1Primitives { + + /** + * @desc FA1 VRU Indication Primitive + */ + type record VamInd { + VAM msgIn, + UInt64 recvTime, + UInt8 gnNextHeader optional, + UInt8 gnHeaderType optional, + UInt8 gnHeaderSubtype optional, + UInt32 gnLifetime optional, + UInt8 gnTrafficClass optional, + UInt16 btpDestinationPort optional, + UInt16 btpInfo optional, + Bit256 ssp optional, + UInt32 its_aid optional + } with { + encode (msgIn) "PER" + } + + /** + * @desc FA1 VRU Request Primitive + */ + type record VamReq { + VAM msgOut + } with { + encode (msgOut) "PER" + } + + } // End of group fa1Primitives + + } // End of group facilityPrimitives + with { + variant "" + encode "LibIts_Interface" + } // End of group interfacePrimitives + +} with { + encode "LibItsVru" + } + // End of module LibItsVru_TypesAndValues \ No newline at end of file diff --git a/lib/asn1 b/lib/asn1 index ba4abd3..7460f52 160000 --- a/lib/asn1 +++ b/lib/asn1 @@ -1 +1 @@ -Subproject commit ba4abd3cd9841460a6dad8f2a5cb45f495832efd +Subproject commit 7460f520a75f86645112c9eedd059706679f5478 diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn index f1519b4..ac1945d 100644 --- a/lib_system/LibItsVru_Functions.ttcn +++ b/lib_system/LibItsVru_Functions.ttcn @@ -1,3 +1,379 @@ module LibItsVru_Functions { + // LibCommon + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + + // LibIts + import from ETSI_ITS_CDD language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_Pixits all; + import from LibItsCommon_Templates all; + import from LibItsCommon_Functions all; + import from LibItsCommon_TypesAndValues all; + + // LibItsVru + import from LibItsVru_TestSystem all; + import from LibItsVru_Templates all; + import from LibItsVru_TypesAndValues all; + import from LibItsVru_Pics all; + import from LibItsVru_Pixits all; + + group utFuntions { + + /** + * @desc Requests to bring the IUT in an initial state + * @param p_init The initialisation to trigger. + */ + function f_utInitializeIut(template (value) UtVruInitialize p_init) runs on ItsVru { + + //deactivate vamPort default alts + vc_vruDefaultActive := false; + + utPort.send(p_init); + tc_wait.start; + alt { + [] utPort.receive(UtVruResults: { utVruInitializeResult := true }) { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT initialized ***"); + } + [] utPort.receive { + tc_wait.stop; + log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_wait.timeout { + log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + //activate vamPort default alts + vc_vruDefaultActive := true; + + } + + } // End of group utFunctions + + group adapterControl { + + /** + * @desc Initialise secure mode if required + */ + function f_initialiseSecuredMode( + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsVru { + + if (PICS_IS_IUT_SECURED == true) { + + if(e_success != f_acTriggerSecEvent(m_acEnableSecurity(p_certificateId))) { + log("*** INFO: TEST CASE NOW STOPPING ITSELF! ***"); + stop; + } + } + + } // End of function f_initialiseSecuredMode() + + function f_uninitialiseSecuredMode() runs on ItsVru { + + if (PICS_IS_IUT_SECURED == true) { + f_acTriggerSecEvent(m_acDisableSecurity); + } + + } // End of function f_initialiseSecuredMode() + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerSecEvent(template (value) AcSecPrimitive p_event) runs on ItsVru return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acSecResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Triggers event in the test system adaptation. + * @param p_event The event to trigger + * @return FncRetCode + */ + function f_acTriggerGnssEvent(template (value) AcGnssPrimitive p_event) runs on ItsVru return FncRetCode { + var FncRetCode v_ret := e_success; + + acPort.send(p_event); + tc_ac.start; + alt { + [] acPort.receive(m_acGnssResponseSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssResponseError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for adapter control event result ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + return v_ret; + } + + /** + * @desc Loads the given scenario + * + * @param p_scenario The scenario to load. + */ + function f_acLoadScenario(in Scenario p_scenario) runs on ItsVru { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_loadScenario(p_scenario)); + } + } // End of function f_acLoadScenario + + /** + * @desc Starts a loaded scenario + */ + function f_acStartScenario() runs on ItsVru { + + if (PX_GNSS_SCENARIO_SUPPORT==true) { + f_acTriggerGnssEvent(m_startScenario); + vc_scenarioStarted := true; + } + } // End of function f_acStartScenario + + /** + * @desc Stops a loaded scenario + */ + function f_acStopScenario() runs on ItsVru { + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + f_acTriggerGnssEvent(m_stopScenario); + vc_scenarioStarted := false; + } + } // End of function f_acStopScenario + + function f_acAwaitTimeInRunningScenario( + integer p_time, + boolean p_stopOnCamMessage := true + ) runs on ItsVru return FncRetCode { + var FncRetCode v_ret := e_success; + + if (PX_GNSS_SCENARIO_SUPPORT==true and vc_scenarioStarted==true) { + + f_acTriggerGnssEvent(m_timeInRunningScenario(p_time)); + + tc_ac.start(int2float(p_time)*1.1); + alt { + [p_stopOnCamMessage] vamPort.check(receive(mw_vamInd ( mw_vamMsg_any ))) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssTimeReachedSuccess) { + tc_ac.stop; + } + [] acPort.receive(m_acGnssTimeReachedError) { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] tc_ac.timeout { + log("*** " & __SCOPE__ & ": ERROR: Timeout while waiting for time reached indication ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + } + + } + return v_ret; + } // End of function f_acAwaitTimeInRunningScenario + + } // End of group adapterControl + + group vruConfigurationFunctions { + + /** + * @desc Setups default configuration + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfUp( + in charstring p_certificateId := PX_CERT_FOR_TS + ) runs on ItsVru system ItsVruSystem { + + map(self:utPort, system:utPort); + map(self:acPort, system:acPort); + map(self:vamPort, system:vamPort); + f_connect4SelfOrClientSync(); + + // Initialise secured mode + f_initialiseSecuredMode(p_certificateId); + + } // End of function f_cfUp + + /** + * @desc Deletes default configuration + */ + function f_cfDown() runs on ItsVru system ItsVruSystem { + + // Initialise secured mode + f_uninitialiseSecuredMode(); + + unmap(self:vamPort, system:vamPort); + + f_acStopScenario(); + unmap(self:utPort, system:utPort); + unmap(self:acPort, system:acPort); + f_disconnect4SelfOrClientSync(); + + } // End of function f_cfDown + + } // End of vruConfigurationFunctions + + group defaults { + + /** + * @desc basic default behaviour handling + */ + altstep a_default() runs on ItsVru { + + [vc_vruDefaultActive] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){ + log("*** a_default: INFO: CPM message received in default ***"); + vc_vruReceived := true; + repeat; + } + [vc_vruDefaultActive] vamPort.receive { + log("*** a_default: ERROR: event received on CPM port in default ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ? }) { + log("*** a_default: INFO: TimeReached event received on AC port in default ***"); + repeat; + } + [] acPort.receive(AdapterControlResults: { acGnssSpeedReached := ? }) { + log("*** a_default: INFO: SpeedReached event received on AC port in default ***"); + repeat; + } + [] acPort.receive(AdapterControlResults: { acGnssDistanceCovered := ? }) { + log("*** a_default: INFO: DistanceCovered event received on AC port in default ***"); + repeat; + } + [] acPort.receive { + tc_ac.stop; + log("*** " & __SCOPE__ & ": ERROR: Received unexpected message ***"); + f_selfOrClientSyncAndVerdict("error", e_error); + } + [] any timer.timeout { + log("*** a_default: INCONC: a timer expired in default ***"); + f_selfOrClientSyncAndVerdict("error", e_timeout); + } + [] a_shutdown() { + f_poDefault(); + f_cfDown(); + log("*** a_default: INFO: TEST COMPONENT NOW STOPPING ITSELF! ***"); + stop; + } + }//end altstep a_basicDefault + + /** + * @desc The default for handling upper tester messages. + */ + altstep a_utDefault() runs on ItsVru { + var UtVruEventInd v_event; + [] utPort.receive(UtVruEventInd:?) -> value v_event { + //store every upper tester indication received + vc_utEvents[lengthof(vc_utEvents)] := v_event; + repeat; + } + [] utPort.receive { + log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); + repeat; + } + } + + } // End of defaults + + group preambles { + + /** + * @desc The default preamble. + */ + function f_prDefault() runs on ItsVru { + vc_default := activate(a_default()); + activate(a_utDefault()); + } + + /** + * @desc Initialize the IUT + * @remark No specific actions specified in the base standard + */ + function f_prInitialState( + in Scenario p_scenario := e_staticPosition, + in boolean p_awaitInitialCPM := true, + in template (value) UtVruInitialize p_vruInitialize := m_vruInitialize, + in boolean p_awaitTimeInRunningScenario := true + ) runs on ItsVru { + + f_utInitializeIut(p_vruInitialize); + + f_prDefault(); + + f_acLoadScenario(p_scenario); + + //Allow burst mode at the beginning + f_sleep(1.0); + + vamPort.clear; + + f_acStartScenario(); + if (p_awaitTimeInRunningScenario) { + f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); + } + + if (p_awaitInitialCPM) { + tc_ac.start; + alt { + [] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){ + tc_ac.stop; + log("*** " & testcasename() & ": INFO: Received initial CPM ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Initial CPM not received ***"); + f_selfOrClientSyncAndVerdictPreamble("error", e_timeout); + } + } // End of 'alt' statement + } + + } // End of function f_prInitialState + + } // End of preambles + + group postambles { + + /** + * @desc The default postamble. + */ + function f_poDefault() runs on ItsVru { + } + + } // End of group postambles + } // End of module LibItsVru_Functions \ No newline at end of file diff --git a/lib_system/LibItsVru_TestSystem.ttcn b/lib_system/LibItsVru_TestSystem.ttcn index d53cad0..40631ab 100644 --- a/lib_system/LibItsVru_TestSystem.ttcn +++ b/lib_system/LibItsVru_TestSystem.ttcn @@ -1,3 +1,101 @@ -module LibItsVru_TestSystem { +module LibItsVru_TestSystem language "TTCN-3:2010 Real Time and Performance Testing" { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from VAM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; + import from LibItsCommon_TypesAndValues all; + + // LibItsVru + import from LibItsVru_TypesAndValues all; + + group portDefinitions { + + /** + * @desc Adapter control port + */ + type port AdapterControlPort message { + out + AcGnssPrimitive, AcSecPrimitive; + in + AdapterControlResults; + } // end AdapterControlPort + + /** + * @desc Upper Tester port + */ + type port UpperTesterPort message { + out + UtVruInitialize; + in + UtVruResults, UtVruEventInd; + } // end UpperTesterPort + + } // end portDefinitions + group interfacePorts { + + group facilityPorts { + + group fa1Ports { + + /** + * @desc FA1 CPS Port (CPS/BTP/GeoNet/RadioNetwork) + */ + type port VruPort message { + in VamInd; + out VamReq; + } // End of port VruPort + + } // end fa1Ports + + } // End of group facilityPorts + + } // End of group interfacePorts + + group componentDefinitions { + /** + * @desc ITS System Adapter + */ + type component ItsVruSystem { + + port UpperTesterPort utPort; + port AdapterControlPort acPort; + + // FA1 ports + port VruPort vamPort; + } // end component ItsAdapter + + } // End of group componentDefinitions + + /** + * @desc Test component for ITS Facility layer + */ + type component ItsVru extends ItsBaseComponent { + port UpperTesterPort utPort; + port AdapterControlPort acPort; + + // FA1 ports + port VruPort vamPort; + //timers + + //component variables + var VamInd vc_vamMsg; + + //default + var default vc_default := null; + + //global variables + var boolean vc_vruReceived := false; + var UtVruEventIndList vc_utEvents := {}; + + var boolean vc_utDefaultActive := true; + var boolean vc_vruDefaultActive := true; + + } // End of component ItsVru } // End of module LibItsVru_TestSystem \ No newline at end of file -- GitLab From 04534f9e2b43ff46766307669bebb146d8152178 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 27 Jun 2024 10:32:58 +0200 Subject: [PATCH 05/20] Update copyrighs & author --- LICENSE | 2 +- lib/asn1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 87e45c5..950683d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2022 ETSI +Copyright 2019-2024 ETSI Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/lib/asn1 b/lib/asn1 index 7460f52..fa03ab9 160000 --- a/lib/asn1 +++ b/lib/asn1 @@ -1 +1 @@ -Subproject commit 7460f520a75f86645112c9eedd059706679f5478 +Subproject commit fa03ab93e257dde61c5157c1f858794463f019cb -- GitLab From 521d0e647ef7e098961485017ca06f8cb37095ab Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 27 Jun 2024 19:01:21 +0200 Subject: [PATCH 06/20] Rename vru -> vam --- lib/LibItsVru_EncdecDeclarations.ttcn | 4 ++-- lib/LibItsVru_Templates.ttcn | 24 ++++++++++++------------ lib/LibItsVru_TypesAndValues.ttcn | 12 ++++++------ lib/asn1 | 2 +- lib_system/LibItsVru_Functions.ttcn | 10 +++++----- lib_system/LibItsVru_TestSystem.ttcn | 6 +++--- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/LibItsVru_EncdecDeclarations.ttcn b/lib/LibItsVru_EncdecDeclarations.ttcn index a60a208..4ec2a36 100644 --- a/lib/LibItsVru_EncdecDeclarations.ttcn +++ b/lib/LibItsVru_EncdecDeclarations.ttcn @@ -21,10 +21,10 @@ module LibItsVru_EncdecDeclarations { external function fx_dec_VAM (inout bitstring b, out VAM p) return integer with {extension "prototype(sliding) decode(PER)"} - external function fx_enc_UtVruInitialize (UtVruInitialize p) return bitstring + external function fx_enc_UtVamInitialize (UtVamInitialize p) return bitstring with {extension "prototype(convert) encode(UpperTester)"} - external function fx_dec_UtVruEventInd (inout bitstring b, out UtVruEventInd p) return integer + external function fx_dec_UtVamEventInd (inout bitstring b, out UtVamEventInd p) return integer with {extension "prototype(sliding) decode(UpperTester)"} } // End of module LibItsVru_EncdecDeclarations \ No newline at end of file diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn index 74f8ad1..19bd57a 100644 --- a/lib/LibItsVru_Templates.ttcn +++ b/lib/LibItsVru_Templates.ttcn @@ -23,12 +23,12 @@ module LibItsVru_Templates { /** * @desc Receive template for VRU Message (VamPort Primitive) - * @param p_vruMsg Expected VRU Message + * @param p_vamMsg Expected VRU Message */ template VamInd mw_vamInd ( - in template (present) VAM p_vruMsg + in template (present) VAM p_vamMsg ) := { - msgIn := p_vruMsg, + msgIn := p_vamMsg, recvTime := ?, gnNextHeader := *, gnHeaderType := *, @@ -43,7 +43,7 @@ module LibItsVru_Templates { /** * @desc Receive template for VRU Message (VamPort Primitive) - * @param p_vruMsg Expected VRU Message + * @param p_vamMsg Expected VRU Message * @param p_gnNextHeader GN next header value * @param p_gnHeaderType GN header type value * @param p_gnHeaderSubtype GN header subtype value @@ -51,7 +51,7 @@ module LibItsVru_Templates { * @param p_gnTrafficClass GN traffic class value */ template VamInd mw_vamIndWithGnParameters ( - in template (present) VAM p_vruMsg, + in template (present) VAM p_vamMsg, in template UInt8 p_gnNextHeader := *, in template UInt8 p_gnHeaderType := *, in template UInt8 p_gnHeaderSubtype := *, @@ -72,7 +72,7 @@ module LibItsVru_Templates { * @param p_its_aid ITS-AID value */ template VamInd mw_vamIndWithSecurityParameters( - template (present) VAM p_vruMsg, + template (present) VAM p_vamMsg, template Bit256 p_ssp := *, template UInt32 p_its_aid := c_its_aid_CAM ) modifies mw_vamInd := { @@ -82,12 +82,12 @@ module LibItsVru_Templates { /** * @desc Receive template for VRU Message (VamPort Primitive) - * @param p_vruMsg Expected VRU Message + * @param p_vamMsg Expected VRU Message * @param p_btpDestinationPort BTP destination port value * @param p_btpInfo BTP destination port info value (if BTP-B) or BTP source port value (if BTP-A) */ template VamInd mw_vamIndWithBtpParameters( - in template (present) VAM p_vruMsg, + in template (present) VAM p_vamMsg, in template UInt16 p_btpDestinationPort := *, in template UInt16 p_btpInfo := * ) modifies mw_vamInd := { @@ -97,12 +97,12 @@ module LibItsVru_Templates { /** * @desc Send template for VRU Message (VamPort Primitive) - * @param p_vruMsg VRU Message to be received + * @param p_vamMsg VRU Message to be received */ template (value) VamReq m_vruReq( - in template (value) VAM p_vruMsg + in template (value) VAM p_vamMsg ) := { - msgOut := p_vruMsg + msgOut := p_vamMsg } // End of template m_vruReq group vruUtPrimitives { @@ -110,7 +110,7 @@ module LibItsVru_Templates { /** * @desc Initializes the VRU IUT. */ - template (value) UtVruInitialize m_vruInitialize := { + template (value) UtVamInitialize m_vruInitialize := { hashedId8 := '0000000000000000'O } diff --git a/lib/LibItsVru_TypesAndValues.ttcn b/lib/LibItsVru_TypesAndValues.ttcn index f44dc49..ba03401 100644 --- a/lib/LibItsVru_TypesAndValues.ttcn +++ b/lib/LibItsVru_TypesAndValues.ttcn @@ -14,7 +14,7 @@ module LibItsVru_TypesAndValues { * @desc Upper Tester message to initialize IUT * @member hashedId8 In case of secured mode set, hashedId8 indicate which certificate the IUT shall use */ - type record UtVruInitialize { + type record UtVamInitialize { Oct8 hashedId8 } with { variant "FIELDORDER(msb)" @@ -23,16 +23,16 @@ module LibItsVru_TypesAndValues { /** * @desc Upper Tester results message of the VRU IUT */ - type union UtVruResults { - boolean utVruInitializeResult + type union UtVamResults { + boolean utVamInitializeResult } with { variant "" - } // End of type UtVruResults + } // End of type UtVamResults /** * @desc Upper Tester message to check event/status on VRU IUT */ - type record UtVruEventInd { + type record UtVamEventInd { VAM vamMsg // TODO Rename into caMsg to be compliant with UtDenmEventInd } with { encode (vamMsg) "LibItsVru_asn1" @@ -41,7 +41,7 @@ module LibItsVru_TypesAndValues { /** * @desc List of Upper Tester messages to check event/status on VRU IUT */ - type record of UtVruEventInd UtVruEventIndList; + type record of UtVamEventInd UtVamEventIndList; } with { encode "UpperTester" diff --git a/lib/asn1 b/lib/asn1 index fa03ab9..360191d 160000 --- a/lib/asn1 +++ b/lib/asn1 @@ -1 +1 @@ -Subproject commit fa03ab93e257dde61c5157c1f858794463f019cb +Subproject commit 360191dc8314cb71d146218821cf3a2b889ecf76 diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn index ac1945d..7adeb2c 100644 --- a/lib_system/LibItsVru_Functions.ttcn +++ b/lib_system/LibItsVru_Functions.ttcn @@ -27,7 +27,7 @@ module LibItsVru_Functions { * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ - function f_utInitializeIut(template (value) UtVruInitialize p_init) runs on ItsVru { + function f_utInitializeIut(template (value) UtVamInitialize p_init) runs on ItsVru { //deactivate vamPort default alts vc_vruDefaultActive := false; @@ -35,7 +35,7 @@ module LibItsVru_Functions { utPort.send(p_init); tc_wait.start; alt { - [] utPort.receive(UtVruResults: { utVruInitializeResult := true }) { + [] utPort.receive(UtVamResults: { utVamInitializeResult := true }) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } @@ -297,8 +297,8 @@ module LibItsVru_Functions { * @desc The default for handling upper tester messages. */ altstep a_utDefault() runs on ItsVru { - var UtVruEventInd v_event; - [] utPort.receive(UtVruEventInd:?) -> value v_event { + var UtVamEventInd v_event; + [] utPort.receive(UtVamEventInd:?) -> value v_event { //store every upper tester indication received vc_utEvents[lengthof(vc_utEvents)] := v_event; repeat; @@ -328,7 +328,7 @@ module LibItsVru_Functions { function f_prInitialState( in Scenario p_scenario := e_staticPosition, in boolean p_awaitInitialCPM := true, - in template (value) UtVruInitialize p_vruInitialize := m_vruInitialize, + in template (value) UtVamInitialize p_vruInitialize := m_vruInitialize, in boolean p_awaitTimeInRunningScenario := true ) runs on ItsVru { diff --git a/lib_system/LibItsVru_TestSystem.ttcn b/lib_system/LibItsVru_TestSystem.ttcn index 40631ab..58692eb 100644 --- a/lib_system/LibItsVru_TestSystem.ttcn +++ b/lib_system/LibItsVru_TestSystem.ttcn @@ -31,9 +31,9 @@ module LibItsVru_TestSystem language "TTCN-3:2010 Real Time and Performance Test */ type port UpperTesterPort message { out - UtVruInitialize; + UtVamInitialize; in - UtVruResults, UtVruEventInd; + UtVamResults, UtVamEventInd; } // end UpperTesterPort } // end portDefinitions @@ -91,7 +91,7 @@ module LibItsVru_TestSystem language "TTCN-3:2010 Real Time and Performance Test //global variables var boolean vc_vruReceived := false; - var UtVruEventIndList vc_utEvents := {}; + var UtVamEventIndList vc_utEvents := {}; var boolean vc_utDefaultActive := true; var boolean vc_vruDefaultActive := true; -- GitLab From fd1aabe32f0d8d6bb47855880466db4deb53b132 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 2 Jul 2024 10:12:47 +0200 Subject: [PATCH 07/20] Create send/receive TTCN-3 templates for all CDD types to be re-used in all ATSs --- ItsVru_TpFunctions.ttcn | 1 + lib/LibItsVru_Templates.ttcn | 205 +++++++++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+) diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 35a2fd4..87805f4 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -16,6 +16,7 @@ module ItsVru_TpFunctions { import from LibItsCommon_Functions all; import from LibItsCommon_Pixits all; import from LibItsCommon_ASN1_NamedNumbers all; + import from LibItsCommon_CddTemplates all; // LibItsVru import from LibItsVru_TestSystem all; diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn index 19bd57a..a25f139 100644 --- a/lib/LibItsVru_Templates.ttcn +++ b/lib/LibItsVru_Templates.ttcn @@ -15,6 +15,7 @@ module LibItsVru_Templates { import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; import from LibItsCommon_ASN1_NamedNumbers all; + import from LibItsCommon_CddTemplates all; // LibItsVru import from LibItsVru_TypesAndValues all; @@ -133,4 +134,208 @@ module LibItsVru_Templates { } } + template (value) VruAwareness m_vru_awareness( + in template (value) GenerationDeltaTime p_generation_delta_time, + in template (value) VamParameters p_vam_parameters + ) := { + generationDeltaTime := p_generation_delta_time, + vamParameters := p_vam_parameters + } + + template (present) VruAwareness mw_vru_awareness( + template (present) GenerationDeltaTime p_generation_delta_time := ?, + template (present) VamParameters p_vam_parameters := ? + ) := { + generationDeltaTime := p_generation_delta_time, + vamParameters := p_vam_parameters + } + + template (omit) VamParameters m_vam_parameters( + in template (value) BasicContainer p_basic_container, + in template (value) VruHighFrequencyContainer p_vru_high_frequency_container, + in template (omit) VruLowFrequencyContainer p_vru_low_frequency_container := omit, + in template (omit) VruClusterInformationContainer p_vru_cluster_information_container := omit, + in template (omit) VruClusterOperationContainer p_vru_cluster_operation_container := omit, + in template (omit) VruMotionPredictionContainer p_vru_motion_prediction_container := omit + ) := { + basicContainer := p_basic_container, + vruHighFrequencyContainer := p_vru_high_frequency_container, + vruLowFrequencyContainer := p_vru_low_frequency_container, + vruClusterInformationContainer := p_vru_cluster_information_container, + vruClusterOperationContainer := p_vru_cluster_operation_container, + vruMotionPredictionContainer := p_vru_motion_prediction_container + } + + template (present) VamParameters mw_vam_parameters( + template (present) BasicContainer p_basic_container := ?, + template (present) VruHighFrequencyContainer p_vru_high_frequency_container := ?, + template VruLowFrequencyContainer p_vru_low_frequency_container := *, + template VruClusterInformationContainer p_vru_cluster_information_container := *, + template VruClusterOperationContainer p_vru_cluster_operation_container := *, + template VruMotionPredictionContainer p_vru_motion_prediction_container := * + ) := { + basicContainer := p_basic_container, + vruHighFrequencyContainer := p_vru_high_frequency_container, + vruLowFrequencyContainer := p_vru_low_frequency_container, + vruClusterInformationContainer := p_vru_cluster_information_container, + vruClusterOperationContainer := p_vru_cluster_operation_container, + vruMotionPredictionContainer := p_vru_motion_prediction_container + } + + template (omit) VruHighFrequencyContainer m_vru_high_frequency_container( + in template (value) Wgs84Angle p_heading, + in template (value) Speed p_speed, + in template (value) LongitudinalAcceleration p_longitudinal_acceleration, + in template (omit) Curvature p_curvature := omit, + in template (omit) CurvatureCalculationMode p_curvature_calculation_mode := omit, + in template (omit) YawRate p_yaw_rate := omit, + in template (omit) LateralAcceleration p_lateral_acceleration := omit, + in template (omit) VerticalAcceleration p_vertical_acceleration := omit, + in template (omit) GeneralizedLanePosition p_vru_lane_position := omit, + in template (omit) VruEnvironment p_environment := omit, + in template (omit) VruMovementControl p_movement_control := omit, + in template (omit) Wgs84Angle p_orientation := omit, + in template (omit) CartesianAngle p_roll_angle := omit, + in template (omit) VruDeviceUsage p_device_usage := omit + ) := { + heading := p_heading, + speed := p_speed, + longitudinalAcceleration := p_longitudinal_acceleration, + curvature := p_curvature, + curvatureCalculationMode := p_curvature_calculation_mode, + yawRate := p_yaw_rate, + lateralAcceleration := p_lateral_acceleration, + verticalAcceleration := p_vertical_acceleration, + vruLanePosition := p_vru_lane_position, + environment := p_environment, + movementControl := p_movement_control, + orientation := p_orientation, + rollAngle := p_roll_angle, + deviceUsage := p_device_usage + } + + template (present) VruHighFrequencyContainer mw_vru_high_frequency_container( + template (present) Wgs84Angle p_heading := ?, + template (present) Speed p_speed := ?, + template (present) LongitudinalAcceleration p_longitudinal_acceleration := ?, + template Curvature p_curvature := *, + template CurvatureCalculationMode p_curvature_calculation_mode := *, + template YawRate p_yaw_rate := *, + template LateralAcceleration p_lateral_acceleration := *, + template VerticalAcceleration p_vertical_acceleration := *, + template GeneralizedLanePosition p_vru_lane_position := *, + template VruEnvironment p_environment := *, + template VruMovementControl p_movement_control := *, + template Wgs84Angle p_orientation := *, + template CartesianAngle p_roll_angle := *, + template VruDeviceUsage p_device_usage := * + ) := { + heading := p_heading, + speed := p_speed, + longitudinalAcceleration := p_longitudinal_acceleration, + curvature := p_curvature, + curvatureCalculationMode := p_curvature_calculation_mode, + yawRate := p_yaw_rate, + lateralAcceleration := p_lateral_acceleration, + verticalAcceleration := p_vertical_acceleration, + vruLanePosition := p_vru_lane_position, + environment := p_environment, + movementControl := p_movement_control, + orientation := p_orientation, + rollAngle := p_roll_angle, + deviceUsage := p_device_usage + } + + template (omit) VruLowFrequencyContainer m_vru_low_frequency_container( + in template (value) VruProfileAndSubprofile p_profile_and_subprofile, + in template (omit) VruSizeClass p_size_class := omit, + in template (omit) VruExteriorLights p_exterior_lights := omit + ) := { + profileAndSubprofile := p_profile_and_subprofile, + sizeClass := p_size_class, + exteriorLights := p_exterior_lights + } + + template (present) VruLowFrequencyContainer mw_vru_low_frequency_container( + template (present) VruProfileAndSubprofile p_profile_and_subprofile := ?, + template VruSizeClass p_size_class := *, + template VruExteriorLights p_exterior_lights := * + ) := { + profileAndSubprofile := p_profile_and_subprofile, + sizeClass := p_size_class, + exteriorLights := p_exterior_lights + } + + template (value) VruClusterInformationContainer m_vru_cluster_information_container( + in template (value) VruClusterInformation p_vru_cluster_information + ) := { + vruClusterInformation := p_vru_cluster_information + } + + template (present) VruClusterInformationContainer mw_vru_cluster_information_container( + template (present) VruClusterInformation p_vru_cluster_information := ? + ) := { + vruClusterInformation := p_vru_cluster_information + } + + template (omit) VruClusterOperationContainer m_vru_cluster_operation_container( + in template (omit) ClusterJoinInfo p_cluster_join_info := omit, + in template (omit) ClusterLeaveInfo p_cluster_leave_info := omit, + in template (omit) ClusterBreakupInfo p_cluster_breakup_info := omit, + in template (omit) DeltaTimeQuarterSecond p_cluster_id_change_time_info := omit + ) := { + clusterJoinInfo := p_cluster_join_info, + clusterLeaveInfo := p_cluster_leave_info, + clusterBreakupInfo := p_cluster_breakup_info, + clusterIdChangeTimeInfo := p_cluster_id_change_time_info + } + + template VruClusterOperationContainer mw_vru_cluster_operation_container( + template ClusterJoinInfo p_cluster_join_info := *, + template ClusterLeaveInfo p_cluster_leave_info := *, + template ClusterBreakupInfo p_cluster_breakup_info := *, + template DeltaTimeQuarterSecond p_cluster_id_change_time_info := * + ) := { + clusterJoinInfo := p_cluster_join_info, + clusterLeaveInfo := p_cluster_leave_info, + clusterBreakupInfo := p_cluster_breakup_info, + clusterIdChangeTimeInfo := p_cluster_id_change_time_info + } + + template (omit) VruMotionPredictionContainer m_vru_motion_prediction_container( + in template (omit) PathHistory p_path_history := omit, + in template (omit) PathPredicted p_path_prediction := omit, + in template (omit) SequenceOfSafeDistanceIndication p_safe_distance := omit, + in template (omit) SequenceOfTrajectoryInterceptionIndication p_trajectory_interception_indication := omit, + in template (omit) AccelerationChangeIndication p_acceleration_change_indication := omit, + in template (omit) HeadingChangeIndication p_heading_change_indication := omit, + in template (omit) StabilityChangeIndication p_stability_change_indication := omit + ) := { + pathHistory := p_path_history, + pathPrediction := p_path_prediction, + safeDistance := p_safe_distance, + trajectoryInterceptionIndication := p_trajectory_interception_indication, + accelerationChangeIndication := p_acceleration_change_indication, + headingChangeIndication := p_heading_change_indication, + stabilityChangeIndication := p_stability_change_indication + } + + template VruMotionPredictionContainer mw_vru_motion_prediction_container( + template PathHistory p_path_history := *, + template PathPredicted p_path_prediction := *, + template SequenceOfSafeDistanceIndication p_safe_distance := *, + template SequenceOfTrajectoryInterceptionIndication p_trajectory_interception_indication := *, + template AccelerationChangeIndication p_acceleration_change_indication := *, + template HeadingChangeIndication p_heading_change_indication := *, + template StabilityChangeIndication p_stability_change_indication := * + ) := { + pathHistory := p_path_history, + pathPrediction := p_path_prediction, + safeDistance := p_safe_distance, + trajectoryInterceptionIndication := p_trajectory_interception_indication, + accelerationChangeIndication := p_acceleration_change_indication, + headingChangeIndication := p_heading_change_indication, + stabilityChangeIndication := p_stability_change_indication + } + } // End of module LibItsVru_Templates \ No newline at end of file -- GitLab From 5f69d1faa68f24fc319e391fa68b460ccc8f0511 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 6 Feb 2025 09:57:01 +0100 Subject: [PATCH 08/20] Implementing TP/VBS/MSGF/BV-01 to TP/VBS/MSGF/BV-20, TP/VBS/IFGN/BV-0x and TC_VBS_SECC_BV_02 & TC_VBS_SECC_BV_04 --- ItsVru_TestCases.ttcn | 1228 ++++++++++++- ItsVru_TestControl.ttcn | 47 +- ItsVru_TpFunctions.ttcn | 2423 +++++++++++++++++++++++++- lib/LibItsVru_Pics.ttcn | 44 +- lib/LibItsVru_Pixits.ttcn | 35 + lib/LibItsVru_Templates.ttcn | 63 +- lib/LibItsVru_TypesAndValues.ttcn | 13 +- lib_system/LibItsVru_Functions.ttcn | 180 +- lib_system/LibItsVru_TestSystem.ttcn | 2 +- 9 files changed, 3880 insertions(+), 155 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index a7a9515..c2f0b53 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -1,103 +1,1149 @@ module ItsVru_TestCases { + // Libcommon + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibItsCommon + import from LibItsCommon_TestSystem all; + // LibItsVru import from LibItsVru_TestSystem all; - + import from LibItsVru_Functions all; + import from LibItsVru_Pics all; + // Ats Its import from ItsVru_TpFunctions all; + group message_format { + + /** + * @desc Check that protocolVersion is set to 3 and messageID is set to 16 + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing ITS PDU header
+     *                  containing protocolVersion
+     *                      indicating value 3
+     *              and containing messageID
+     *                  indicating value 16
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-01 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.2 + */ + testcase TC_VBS_MSGF_BV_01() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_01(); + + } // End of TC_VBS_MSGF_BV_01 + + /** + * @desc Check that the generation time in the VAM is the time of reference position since ITS epoch modulo 2^16 + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing generation time
+     *                  indicating reference position time in milliseconds since ITS epoch mod 2^16
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.2 + */ + testcase TC_VBS_MSGF_BV_02() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_02(); + + } // End of TC_VBS_MSGF_BV_02 + + /** + * @desc Check that stationType only takes supported values + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing BasicContainer
+     *                      containing stationType
+     *                          indicating pedestrian or
+     *                          indicating cyclist or
+     *                          indicating moped or
+     *                          indicating motorcycle or
+     *                          indicating lightVruVehicle or
+     *                          indicating animal
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-03 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.1 + */ + testcase TC_VBS_MSGF_BV_03() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_03(); + + } // End of TC_VBS_MSGF_BV_03 + + /** + * @desc Check that the reference point is the ground position of the center of the front side of the bounding box of the VRU + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing BasicContainer
+     *                      containing ReferencePosition
+     *                          indicating ground position of the center of the front side of the bounding box
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-04 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.1 + */ + testcase TC_VBS_MSGF_BV_04() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_04(); + + } // End of TC_VBS_MSGF_BV_04 + + /** + * @desc Check that the curvature includes the curvatureValue which is the inverse of the VRU curve radius and the turning direction of the curve + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU is following a curve with radius RADIUS and turning direction DIRECTION
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruHighFrequencyContainer
+     *                      containing curvature
+     *                          containing curvatureValue
+     *                              indicating DIRECTION * 1/(RADIUS*10000)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-05 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 + */ + testcase TC_VBS_MSGF_BV_05() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_05(); + + } // End of TC_VBS_MSGF_BV_05 + + /** + * @desc Check that the yawRate includes the yawRateValue + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has a yaw rate of YAW_RATE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruHighFrequencyContainer
+     *                      containing yawRate
+     *                          containing yawRateValue
+     *                              indicating YAW_RATE
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-06 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 + */ + testcase TC_VBS_MSGF_BV_06() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_06(); + + } // End of TC_VBS_MSGF_BV_06 + + /** + * @desc Check that the lateralAcceleration indicates the lateral acceleration perpendicular to the heading direction + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has a lateral acceleration of LAT_ACC
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruHighFrequencyContainer
+     *                      containing lateralAcceleration
+     *                          containing yawRateValue
+     *                              indicating LAT_ACC
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-07 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 + */ + testcase TC_VBS_MSGF_BV_07() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_07(); + + } // End of TC_VBS_MSGF_BV_07 + + /** + * @desc Check that the vruLanePosition describes a lane on the road, a lane off the road or an island between two lanes + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU in lane LANE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruHighFrequencyContainer
+     *                      containing simpleLanePosition
+     *                          indicating lane LANE
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-08 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 + */ + testcase TC_VBS_MSGF_BV_08() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_08(); + + } // End of TC_VBS_MSGF_BV_08 + + /** + * @desc Check that the orientation defines the angle between the longitudinal axis and WGS84 north + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU in lane LANE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruHighFrequencyContainer
+     *                      containing orientation
+     *                          indicating lane LANE
+     *                              containing headingValue
+     *                                  indicating value HEADING
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-09 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 + */ + testcase TC_VBS_MSGF_BV_09() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_09(); + + } // End of TC_VBS_MSGF_BV_09 + + /** + * @desc Check that the rollAngle includes the angle between the ground plane and the vehicle's y-axis as well as the angle accuracy and that no values between 500 and 3100 are used + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has roll angle heading of ROLL_ANGLE with heading confidence of CONFIDENCE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruHighFrequencyContainer
+     *                      containing rollAnlge
+     *                          containing headingValue
+     *                              indicating value ROLL_ANGLE
+     *                          and containing headingConfidence
+     *                              indicating value CONFIDENCE < 500 and CONFIDENCE > 3100
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-10 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 + */ + testcase TC_VBS_MSGF_BV_10() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_10(); + + } // End of TC_VBS_MSGF_BV_10 + + /** + * @desc Check that the deviceUsage uses values between 0 and 8 + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU in profile pedestrian (1)
+     *         and VRU has deviceUsage D
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruHighFrequencyContainer
+     *                      containing deviceUsage
+     *                          indicating value D
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-11 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 + */ + testcase TC_VBS_MSGF_BV_11() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_11(); + + } // End of TC_VBS_MSGF_BV_11 + + /** + * @desc Check that the profileAndSubprofile contains the profile and sub-profile of the VRU if the VRU LF container is present + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has profile PROFILE and sub-profile SUBPROFILE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *          and VRU LF container is present
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruLowFrequencyContainer
+     *                      containing profileAndSubprofile
+     *                          indicating value included in PROFILE
+     *                          containing sub-profile
+     *                              indicating value included in SUBPROFILE
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-12 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4 + */ + testcase TC_VBS_MSGF_BV_12() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_12(); + + } // End of TC_VBS_MSGF_BV_12 + + /** + * @desc Check that the sizeClass contains size information of the VRU + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has sizeClass SC
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *          and VRU LF container is present
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruLowFrequencyContainer
+     *                      containing sizeClass
+     *                          indicating value SC
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-13 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4 + */ + testcase TC_VBS_MSGF_BV_13() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_13(); + + } // End of TC_VBS_MSGF_BV_13 + + /** + * @desc Check that exteriorLights is present for VRU profile 2 + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU in profile bicyclist (2)
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *          and VRU LF container is present
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruLowFrequencyContainer
+     *                      containing exteriorLights
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-14 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4 + */ + testcase TC_VBS_MSGF_BV_14() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_MSGF_BV_14(); + + } // End of TC_VBS_MSGF_BV_14 + + /** + * @desc Check that clusterProfiles is not set to zeros if VRU has profile 1, 2 or 4 + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING or PICS_PROFILE_PEDESTRIAN or PICS_PROFILE_BICYCLIST or PICS_PROFILE_ANIMAL
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU is part of cluster
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterInformationContainer
+     *                      containing clusterProfiles
+     *                          not indicating value 0000
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-15 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_15() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_PROFILE_PEDESTRIAN or PICS_PROFILE_BICYCLIST or PICS_PROFILE_ANIMAL and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_PROFILE_PEDESTRIAN or PICS_PROFILE_BICYCLIST or PICS_PROFILE_ANIMAL and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_15_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_15 + + /** + * @desc Check that clusterLeaveReason indicates clusterLeaderLost when the cluster leader is lost + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *         and VRU has last received a cluster VRU from cluster leader at time T1
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          timeClusterContinuity has passed since T1
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating clusterLeaderLost (1)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-16 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_16() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_16_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_16_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_16 + + /** + * @desc Check that clusterLeaveReason indicates clusterDisbandedByLeader when the cluster leader breaks up the cluster + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          the IUT receives VAM 
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterBreakupInfo
+     *          from cluster leader
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating clusterDisbandedByLeader (2)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-17 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_17() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_17_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_17_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_17 + + /** + * @desc Check that clusterLeaveReason indicates outOfClusterBoundingBox when the VRU moves out of the cluster bounding box + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-PASSIVE and
+     *         VRU has received a cluster VAM from cluster leader
+     *             containing vruClusterInformationContainer
+     *                 containing clusterBoundingBoxShape
+     *                     indicating Shape S
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          the IUT is alerted about new reference position value P and 
+     *          P is not inside S
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating outOfClusterBoundingBox (3)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-18 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_18() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_18_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_18_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_18 + + /** + * @desc Check that clusterLeaveReason indicates outOfClusterSpeedRange when the VRU is out of the cluster speed range + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-PASSIVE and
+     *         VRU has received a cluster VAM from cluster leader
+     *             containing vruHighFrequencyContainer
+     *                 containing speed
+     *                     containing speedValue
+     *                         indicating value SPEED_1
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          The IUT is alerted about new own speed value SPEED_2 and
+     *          abs(SPEED_2 - SPEED_1) > maxClusterVelocityDifference
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating outOfClusterSpeedRange (4)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-19 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_19() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_19_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_19_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_19 + + /** + * @desc Check that clusterLeaveReason indicates joiningAnotherCluster when the VRU is joining another cluster + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          The IUT has received a VAM from another cluster leader
+     *              containing vruClusterInformationContainer
+     *                  containing clusterId
+     *                      indicating CId
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating joiningAnotherCluster (5)
+     *                      and containing clusterJoinInfo
+     *                          containing clusterId
+     *                              indicating CId
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-20 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_20() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader_1; + var ItsVru v_vam_cluster_leader_2; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + + // Start components + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_20_cluster_leader_1()); + v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_20_cluster_leader_2()); + v_iut.start(f_TC_VBS_MSGF_BV_20_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_20 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } // End of group message_format + group vruLowerLayerParameters { /** - * @desc Check that VAM is encapsulated in BTP type B packet - *
-    * Pics Selection: PICS_VRU_GENERATION AND NOT PICS_IS_IUT_SECURED
-    * Initial conditions: 
-    *     with {
-    *         the IUT being in the "initial state"
-    *     }
-    * Expected behaviour:
-    *  ensure that {
-    *      when {
-    *          a CollectivePerceptionMessage is generated
-    *      }
-    *      then {
-    *          the IUT sends a CollectivePerceptionMessage
-    *              encapsulated in a BTP-B packet
-    *      }
-    *  } 
-    * 
- * - * @see ETSI TS 104 018-2 v1.5.1 TP/VRU/MSD/PAR/BV-01 - * @reference ETSI EN 302 637-2 v1.4.1, clause 5.3.4.1 - */ - testcase TC_VRU_MSD_PAR_BV_01() runs on ItsVru system ItsVruSystem { - - f_VRU_MSD_PAR_BV_01(); - - } // End of TC_VRU_MSD_PAR_BV_01 - - /** - * @desc Check that VAM is encapsulated in SHB packet - *
-    * Pics Selection: PICS_VRU_GENERATION AND NOT PICS_IS_IUT_SECURED
-    * Initial conditions: 
-    *     with {
-    *         the IUT being in the "initial state"
-    *     }
-    * Expected behaviour:
-    *  ensure that {
-    *      when {
-    *          a CollectivePerceptionMessage is generated
-    *      }
-    *      then {
-    *          the IUT sends a CollectivePerceptionMessage
-    *              encapsulated in a SHB packet
-    *      }
-    *  } 
-    * 
- * - * @see ETSI TS 104 018-2 v1.5.1 TP/VRU/MSD/PAR/BV-02 - * @reference ETSI EN 302 637-2 v1.4.1, clause 5.3.4.1 - */ - testcase TC_VRU_MSD_PAR_BV_02() runs on ItsVru system ItsVruSystem { - - f_VRU_MSD_PAR_BV_02(); - - } // End of TC_VRU_MSD_PAR_BV_02 - - /** - * @desc Check that VRU is encapsulated in GN packet with lifetime lower than 1s - *
-    * Pics Selection: PICS_VRU_GENERATION AND NOT PICS_IS_IUT_SECURED
-    * Initial conditions: 
-    *     with {
-    *         the IUT being in the "initial state"
-    *     }
-    * Expected behaviour:
-    *  ensure that {
-    *      when {
-    *          a CollectivePerceptionMessage is generated
-    *      }
-    *      then {
-    *          the IUT sends a VAM
-    *              encapsulated in a GN packet
-    *                  containing Basic Header
-    *                      containing Lifetime field 
-    *                          indicating value lower than 1s
-    *      }
-    *  } 
-    * 
- * - * @see ETSI TS 104 018-2 v1.5.1 TP/VRU/MSD/PAR/BV-03 - * @reference ETSI EN 302 637-2 v1.4.1, clause 5.3.4.1 - */ - testcase TC_VRU_MSD_PAR_BV_03() runs on ItsVru system ItsVruSystem { - - f_VRU_MSD_PAR_BV_03(); - - } // End of TC_VRU_MSD_PAR_BV_03 - - } // End of vruLowerLayerParameters + * @desc Check that the BTP header type B and the destination port is passed if the value is not provided by the ITS-S configuration + *
+     * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and data being passed from the VBS to GeoNetworking/BTP
+     *         and BTP type is not privided by the ITS-S configuration
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          Message is sent
+     *              Message is sent
+     *              containing BTP header
+     *                  indicating type B
+     *                  and containing destination port
+     *                      indicating value 2018
+
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-01 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2 + */ + testcase TC_VBS_IFGN_BV_01() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_IFGN_BV_01(); + + } // End of TC_VBS_IFGN_BV_01 + + /** + * @desc Check that the GN packet transport type is GeoNetworking SHB and passed if the value is not provided by the ITS-S configuration + *
+     * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and data being passed from the VBS to GeoNetworking/BTP
+     *         and BTP type is not privided by the ITS-S configuration
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          Message is sent
+     *              containing GeoNetworking header
+     *                  containing Common Header
+     *                  containing Header Type
+     *                      indicating SHB
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2 + */ + testcase TC_VBS_IFGN_BV_02() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_IFGN_BV_02(); + + } // End of TC_VBS_IFGN_BV_02 + + /** + * @desc Check that the GN Traffic class is the same value as for the CAM + *
+     * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and data being passed from the VBS to GeoNetworking/BTP
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          Message is sent
+     *              containing GeoNetworking header
+     *                  containing Common Header
+     *                      containing Traffic Class
+     *                          indicating value TC = 2
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-03 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2 + */ + testcase TC_VBS_IFGN_BV_03() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_IFGN_BV_03(); + + } // End of TC_VBS_IFGN_BV_03 + + } // End of group vruLowerLayerParameters + + + + + + + + group securityConstraints { + + /** + * @desc Check that the ITS-AID indicates the application for which permissions are being granted + *
+     * Pics Selection: PICS_VAM_GENERATION AND PICS_IS_IUT_SECURED
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          Message is sent
+     *              containing GeoNetworking header
+     *                  containing Secure Header
+     *                      containing signedData
+     *                          containing certificate
+     *                              containing Certificate
+     *                                  containing ToBeSigned
+     *                                      containing AppPermissions
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/SECC/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.5.1 + */ + testcase TC_VBS_SECC_BV_02() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_SECC_BV_02(); + + } // End of TC_VBS_SECC_BV_02 + + /** + * @desc Check that the SSP is a BitmapSsp + *
+     * Pics Selection: PICS_VAM_GENERATION AND PICS_IS_IUT_SECURED
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          Message is sent
+     *              containing GeoNetworking header
+     *                  containing Secure Header
+     *                      containing signedData
+     *                          containing certificate
+     *                              containing Certificate
+     *                                  containing ToBeSigned
+     *                                      containing AppPermissions
+     *                                          containing at least one item
+     *                                              containing Bitmap SSP
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/SECC/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.5.2 + */ + testcase TC_VBS_SECC_BV_04() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_SECC_BV_04(); + + } // End of TC_VBS_SECC_BV_04 + + } // End of group securityConstraints } // End of module ItsVru_TestCases \ No newline at end of file diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn index b57d652..b935deb 100644 --- a/ItsVru_TestControl.ttcn +++ b/ItsVru_TestControl.ttcn @@ -9,10 +9,49 @@ module ItsVru_TestControl { // Test Execution control { - if(PICS_VRU_GENERATION) { - execute(TC_VRU_MSD_PAR_BV_01()); - execute(TC_VRU_MSD_PAR_BV_02()); - execute(TC_VRU_MSD_PAR_BV_03()); + if(PICS_VAM_GENERATION) { + execute(TC_VBS_MSGF_BV_01()); + execute(TC_VBS_MSGF_BV_02()); + execute(TC_VBS_MSGF_BV_03()); + execute(TC_VBS_MSGF_BV_04()); + execute(TC_VBS_MSGF_BV_05()); + execute(TC_VBS_MSGF_BV_06()); + execute(TC_VBS_MSGF_BV_07()); + execute(TC_VBS_MSGF_BV_08()); + execute(TC_VBS_MSGF_BV_10()); + execute(TC_VBS_MSGF_BV_12()); + execute(TC_VBS_MSGF_BV_13()); + + if (PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST) { + execute(TC_VBS_MSGF_BV_09()); + } + + if (PICS_PROFILE_PEDESTRIAN) { + execute(TC_VBS_MSGF_BV_11()); + } + + if (PICS_PROFILE_BICYCLIST) { + execute(TC_VBS_MSGF_BV_14()); + } + + if (PICS_CLUSTERING) { + execute(TC_VBS_MSGF_BV_15()); + execute(TC_VBS_MSGF_BV_16()); + execute(TC_VBS_MSGF_BV_17()); + execute(TC_VBS_MSGF_BV_18()); + execute(TC_VBS_MSGF_BV_19()); + execute(TC_VBS_MSGF_BV_20()); + } + + execute(TC_VBS_IFGN_BV_01()); + execute(TC_VBS_IFGN_BV_02()); + execute(TC_VBS_IFGN_BV_03()); + + if (PICS_IS_IUT_SECURED) { + execute(TC_VBS_SECC_BV_02()); + execute(TC_VBS_SECC_BV_04()); + } + } } diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 87805f4..b5b7279 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -18,27 +18,2273 @@ module ItsVru_TpFunctions { import from LibItsCommon_ASN1_NamedNumbers all; import from LibItsCommon_CddTemplates all; + // LibItsGeoNetworking + //import from LibItsGeoNetworking_TypesAndValues all; + // LibItsVru import from LibItsVru_TestSystem all; import from LibItsVru_Functions all; import from LibItsVru_Templates all; import from LibItsVru_TypesAndValues all; import from LibItsVru_Pics all; + import from LibItsVru_Pixits all; + + import from LibItsSecurity_Functions all; + + group message_format { + + /** + * @desc TP Function for TC_VBS_MSGF_BV_01 + */ + function f_TC_VBS_MSGF_BV_01() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg_any + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM messageID is set to 16 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_01 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_02 + */ + function f_TC_VBS_MSGF_BV_02() runs on ItsVru { + // Local variables + var integer v_lower_bound := (f_getCurrentTime() - 5000) mod 65536; // Time unit is millisecond + var integer v_upper_bound := (f_getCurrentTime() + 5000) mod 65536; // Time unit is millisecond + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + (v_lower_bound .. v_upper_bound) + )))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing a generation time modulo 2^16 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_02 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_03 + */ + function f_TC_VBS_MSGF_BV_03() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + mw_basic_container( + (StationType_pedestrian_..StationType_motorcycle_) + //pedestrian, cyclist, moped, motorcycle, lightVruVehicle, animal + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + mw_basic_container( + (12..13) + //pedestrian, cyclist, moped, motorcycle, lightVruVehicle, animal + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_03 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_04 + */ + function f_TC_VBS_MSGF_BV_04() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + mw_basic_container( + -, + LibItsVru_Templates.mw_reference_position + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing reference position ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_04 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_05 + */ + function f_TC_VBS_MSGF_BV_05() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + mw_vru_high_frequency_container( + -, -, -, + mw_curvature + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing curvature value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_05 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_06 + */ + function f_TC_VBS_MSGF_BV_06() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + mw_vru_high_frequency_container( + -, -, -, -, -, -, + mw_lateral_acceleration + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing yaw-rate value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_06 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_07 + */ + function f_TC_VBS_MSGF_BV_07() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + mw_vru_high_frequency_container( + -, -, -, -, -, + mw_yaw_rate + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing yaw-rate value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_07 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_08 + */ + function f_TC_VBS_MSGF_BV_08() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + mw_vru_high_frequency_container( + -, -, -, -, -, -, -, -, + mw_generalized_lane_position + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_08 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_09 + */ + function f_TC_VBS_MSGF_BV_09() runs on ItsVru { + // Local variables + + // Test control + if (not(PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Set VRU profile + f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + mw_vru_high_frequency_container( + -, -, -, -, -, -, -, -, -, -, -, -, + mw_cartesian_angle( + complement((500 .. 3100)) + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing RollAngle angle value (500 .. 3100 range excluded) ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_09 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_10 + */ + function f_TC_VBS_MSGF_BV_10() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + mw_vru_high_frequency_container( + -, -, -, -, -, -, -, -, -, -, -, -, -, + (0 .. 8) + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_10 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_11 + */ + function f_TC_VBS_MSGF_BV_11() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or not PICS_PROFILE_PEDESTRIAN or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Set VRU profile + f_utTriggerEvent(m_setVruProfile(Vru_profile_pedestrian)); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + mw_vru_high_frequency_container( + mw_wgs84_angle + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_11 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_12 + */ + function f_TC_VBS_MSGF_BV_12() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + -, + mw_vru_low_frequency_container( + mw_vru_profile_and_subprofile_pedestrian + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing profile and sub-profile of the VRU ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_12 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_13 + */ + function f_TC_VBS_MSGF_BV_13() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + -, + mw_vru_low_frequency_container( + -, + ? + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing class zize ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_13 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_14 + */ + function f_TC_VBS_MSGF_BV_14() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or not PICS_PROFILE_BICYCLIST or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, + -, + mw_vru_low_frequency_container( + -, -, + ? + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing class zize ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_14 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_15 + */ + group f_TC_VBS_MSGF_BV_15 { + + function f_TC_VBS_MSGF_BV_15_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VamInd v_fisrt_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_fisrt_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + // Delete the cluster + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, -, + m_vru_cluster_operation_container( + m_cluster_breakup_info( + PX_VRU_CLUSTER_BREAKUP_REASON + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster deleted ***"); + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_15_cluster_leader + + function f_TC_VBS_MSGF_BV_15_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the IUT to join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + vamPort.clear; + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container( + mw_vru_cluster_information( + -, -, -, + complement('0000'B) + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_15_iut + + } // End of group f_TC_VBS_MSGF_BV_15 + + group f_TC_VBS_MSGF_BV_16 { + + function f_TC_VBS_MSGF_BV_16_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VamInd v_fisrt_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_fisrt_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + // Do not send VAM anynore + tc_ac.start; + alt { + [] tc_ac.timeout { + log("*** " & testcasename() & ": PASS: No more VAM sent ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } + + function f_TC_VBS_MSGF_BV_16_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_clusterLeaderLost + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_16_iut + + } // End of group f_TC_VBS_MSGF_BV_16 + + group f_TC_VBS_MSGF_BV_17 { + + function f_TC_VBS_MSGF_BV_17_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VamInd v_fisrt_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_fisrt_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster is disbanded + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + -, + m_cluster_leave_info( + Vru_clusterLeaveReason_clusterDisbandedByLeader) + + )))))); + log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_MSGF_BV_17_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_clusterDisbandedByLeader + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_17_iut + + } // End of group f_TC_VBS_MSGF_BV_17 + + group f_TC_VBS_MSGF_BV_18 { + + function f_TC_VBS_MSGF_BV_18_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VamInd v_fisrt_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_fisrt_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence, with important distance + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_OUT_OF_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_OUT_OF_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + ))))))); + log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_MSGF_BV_18_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_outOfClusterBoundingBox + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_18_iut + + } // End of group f_TC_VBS_MSGF_BV_18 + + group f_TC_VBS_MSGF_BV_19 { + + function f_TC_VBS_MSGF_BV_19_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VamInd v_fisrt_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_fisrt_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence and a speed such as abs(SPEED_2 - SPEED_1) > maxClusterVelocityDifference + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_MSGF_BV_19_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_outOfClusterSpeedRange + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_19_iut + + } // End of group f_TC_VBS_MSGF_BV_19 + + group f_TC_VBS_MSGF_BV_20 { + + function f_TC_VBS_MSGF_BV_20_cluster_leader_1() runs on ItsVru system ItsVruSystem { + // Local variables + var VamInd v_fisrt_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_fisrt_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_MSGF_BV_20_cluster_leader_2() runs on ItsVru system ItsVruSystem { + // Local variables + var VamInd v_fisrt_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for the IUT joining a fisrt cluster before to send a a join cluster better that the previous one + f_sleep(PX_TNOAC); + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_fisrt_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID + 1, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID + 1, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + log("*** " & testcasename() & ": PASS: VAM better cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_MSGF_BV_20_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_joiningAnotherCluster + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_20_iut + + } // End of group f_TC_VBS_MSGF_BV_20 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } // End of group message_format - import from LibItsSecurity_Functions all; group vruLowerLayerParameters { /** - * @desc TP Function for TC_VRU_MSD_PAR_BV_01 + * @desc TP Function for TC_VBS_IFGN_BV_01 */ - function f_VRU_MSD_PAR_BV_01() runs on ItsVru { + function f_TC_VBS_IFGN_BV_01() runs on ItsVru { // Local variables const UInt8 c_gnNhBtpB := 2; - + const UInt16 c_btp_port := 2018; + var boolean v_cond_1 := false, v_cond_2 := false; + // Test control - if (not PICS_VRU_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VRU_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -55,24 +2301,34 @@ module ItsVru_TpFunctions { // Test Body tc_ac.start; alt { - [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, c_gnNhBtpB)) { - tc_ac.stop; - log("*** " & testcasename() & ": PASS: Expected VRU message encapsultated in BTP-B packet received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + [v_cond_1 == false] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, c_gnNhBtpB)) { + log("*** " & testcasename() & ": INFO: Expected VRU message encapsultated in BTP-B packet received ***"); + v_cond_1 := true; + repeat; + } + [v_cond_2 == false] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any, c_btp_port)) { + log("*** " & testcasename() & ": INFO: Expected VRU message encapsultated in BTP-B packet received ***"); + v_cond_2 := true; + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [v_cond_1 == true and v_cond_2 == true] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Expected VRU message encapsultated in BTP-B packet with the correct BTP port received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, omit)) { - tc_ac.stop; - log("*** " & testcasename() & ": INCONC: no GN NH information in CpmInd ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + tc_ac.stop; + log("*** " & testcasename() & ": INCONC: no GN NH information in CpmInd ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) { - tc_ac.stop; - log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in BTP-B packet ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in BTP-B packet ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } @@ -80,20 +2336,20 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown(); - } // End of function f_VRU_MSD_PAR_BV_01 + } // End of function f_TC_VBS_IFGN_BV_01 /** - * @desc TP Function for TC_VRU_MSD_PAR_BV_02 + * @desc TP Function for TC_VBS_IFGN_BV_02 */ - function f_VRU_MSD_PAR_BV_02() runs on ItsVru { + function f_TC_VBS_IFGN_BV_02() runs on ItsVru { // Local variables const UInt8 c_gnHtTsb := 5; const UInt8 c_GnHstSingleHop := 0; // Test control - if (not PICS_VRU_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VRU_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -135,19 +2391,18 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown(); - } // End of function f_VRU_MSD_PAR_BV_02 + } // End of function f_TC_VBS_IFGN_BV_02 /** - * @desc TP Function for TC_VRU_MSD_PAR_BV_03 + * @desc TP Function for TC_VBS_IFGN_BV_03 */ - function f_VRU_MSD_PAR_BV_03() runs on ItsVru { + function f_TC_VBS_IFGN_BV_03() runs on ItsVru { // Local variables - var VamInd v_vamInd; // Test control - if (not PICS_VRU_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VRU_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -164,24 +2419,104 @@ module ItsVru_TpFunctions { // Test Body tc_ac.start; alt { - [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any)) -> value v_vamInd { - tc_ac.stop; - if(not ispresent(v_vamInd.gnLifetime)) { - log("*** " & testcasename() & ": INCONC: no GN lifetime information in CpmInd ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, -, -, -, 2)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Expected VRU message received encapsulted in GN packet with correct TC value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } - if(v_vamInd.gnLifetime <= 1000) { - log("*** " & testcasename() & ": PASS: Expected VRU message received encapsulted in GN packet with correct lifetime value ***"); + } + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_IFGN_BV_03 + + } // End of group vruLowerLayerParameters + + group securityConstraints { + + /** + * @desc TP Function for TC_VBS_SECC_BV_02 + */ + function f_TC_VBS_SECC_BV_02() runs on ItsVru { + + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Expected secured VRU message received with correct ITS-AID value ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } - else { - log("*** " & testcasename() & ": FAIL: Expected VRU message received encapsulted in GN packet with incorrect lifetime value ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - } + } + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_SECC_BV_02 + + /** + * @desc TP Function for TC_VBS_SECC_BV_04 + */ + function f_TC_VBS_SECC_BV_04() runs on ItsVru { + + // Local variables + + // Test control + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any, ?)) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Expected secured VRU message received with SSP value ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } @@ -189,8 +2524,8 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown(); - } // End of function f_VRU_MSD_PAR_BV_03 + } // End of function f_TC_VBS_SECC_BV_04 - } // End of group vruLowerLayerParameters + } // End of group securityConstraints } // End of module ItsVru_TpFunctions \ No newline at end of file diff --git a/lib/LibItsVru_Pics.ttcn b/lib/LibItsVru_Pics.ttcn index 6cff8e9..cb1ad73 100644 --- a/lib/LibItsVru_Pics.ttcn +++ b/lib/LibItsVru_Pics.ttcn @@ -4,16 +4,40 @@ module LibItsVru_Pics { import from LibCommon_BasicTypesAndValues all; /** - * @desc Is the IUT running in secured mode? - * @see ETSI TS 104 019-1 Table A.1 + * @desc Support for VRU generation + * @see ETSI TS 104 019-1 Table A.1/1 */ - modulepar boolean PICS_IS_IUT_SECURED := false; - + modulepar boolean PICS_VAM_GENERATION := true; + /** - * @desc Support for VRU generation - * @see ETSI TS 104 019-1 Table A.3 + * @desc Is the IUT vehicle profile Pedestrain? + * @see ETSI TS 104 019-1 Table A.3/1 + */ + modulepar boolean PICS_PROFILE_PEDESTRIAN := false; + + /** + * @desc Is the IUT vehicle profile Bycycle or Light vehicle? + * @see ETSI TS 104 019-1 Table A.3/2 + */ + modulepar boolean PICS_PROFILE_BICYCLIST := true; + + /** + * @desc Is the IUT vehicle profile Motorcyclist? + * @see ETSI TS 104 019-1 Table A.3/3 + */ + modulepar boolean PICS_PROFILE_MOTORCYCLIST := false; + + /** + * @desc Is the IUT vehicle profile Animal? + * @see ETSI TS 104 019-1 Table A.3/3 + */ + modulepar boolean PICS_PROFILE_ANIMAL := false; + + /** + * @desc Is the IUT support clustering? + * @see ETSI TS 104 019-1 Table A.4/1 */ - modulepar boolean PICS_VRU_GENERATION := true; + modulepar boolean PICS_CLUSTERING := true; /** * @desc Support for VRU reception @@ -21,4 +45,10 @@ module LibItsVru_Pics { */ modulepar boolean PICS_VRU_RECEPTION := true; + /** + * @desc Is the IUT running in secured mode? + * @see ETSI TS 104 019-1 Table A.5/1 + */ + modulepar boolean PICS_IS_IUT_SECURED := false; + } // End of module LibItsVru_Pics \ No newline at end of file diff --git a/lib/LibItsVru_Pixits.ttcn b/lib/LibItsVru_Pixits.ttcn index f056b5b..d784b72 100644 --- a/lib/LibItsVru_Pixits.ttcn +++ b/lib/LibItsVru_Pixits.ttcn @@ -1,3 +1,38 @@ module LibItsVru_Pixits { + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + + // LibIts + import from ETSI_ITS_CDD language "ASN.1:1997" all; + import from VAM_PDU_Descriptions language "ASN.1:1997" all; + + // LibItsCommon + import from LibItsCommon_ASN1_NamedNumbers all; + + modulepar UInt8 PX_IUT_VRU_PROFILE_TYPE := 2; + + modulepar CardinalNumber1B PX_VRU_CLUSTER_CREATE_CARDINALITY := 3; + + modulepar Identifier1B PX_VRU_CLUSTER_CREATE_ID := 78; // Random number + + modulepar StandardLength12b PX_VRU_CLUSTER_CREATE_RADIUS := 30; // 3 meters + + modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE := '0000'B; // At least on pedestrian + + modulepar ClusterBreakupReason PX_VRU_CLUSTER_BREAKUP_REASON := Vru_ClusterBreakupReason_clusteringPurposeCompleted; + + modulepar UInt32 PX_DELTA_LATITUDE_IN_BOX := 10; + + modulepar UInt32 PX_DELTA_LONGITUDE_IN_BOX := 10; + + modulepar UInt32 PX_DELTA_LATITUDE_OUT_OF_BOX := 100; + + modulepar UInt32 PX_DELTA_LONGITUDE_OUT_OF_BOX := 100; + + modulepar UInt32 PX_DELTA_SPEED_IN_BOX := 2; + + modulepar UInt32 PX_DELTA_SPEED_OUT_OF_BOX := 20; + } // End of module LibItsVru_Pixits \ No newline at end of file diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn index a25f139..0895ed6 100644 --- a/lib/LibItsVru_Templates.ttcn +++ b/lib/LibItsVru_Templates.ttcn @@ -67,7 +67,7 @@ module LibItsVru_Templates { } // End of template mw_vamIndWithGnParameters /** - * @desc Receive template for CA Message (DenmPort Primitive) + * @desc Receive template for VRU Message (VamPort Primitive) * @param p_caMsg The expected CA Message * @param p_ssp SSP security parameter * @param p_its_aid ITS-AID value @@ -75,7 +75,7 @@ module LibItsVru_Templates { template VamInd mw_vamIndWithSecurityParameters( template (present) VAM p_vamMsg, template Bit256 p_ssp := *, - template UInt32 p_its_aid := c_its_aid_CAM + template UInt32 p_its_aid := c_its_aid_VAM ) modifies mw_vamInd := { ssp := p_ssp, its_aid := p_its_aid @@ -115,6 +115,14 @@ module LibItsVru_Templates { hashedId8 := '0000000000000000'O } + /** + * @desc Set the VRU profile + * @param p_vru_profile The VRU profile + */ + template (value) UtVamTrigger m_setVruProfile(in UInt8 p_vru_profile) := { + setVruProfile := p_vru_profile + } + } // End of group utPrimitives } // End of group Primitives @@ -134,6 +142,30 @@ module LibItsVru_Templates { } } + /** + * @desc Send template for VAM PDU + */ + template (value) VAM m_vamMsg( + in StationId p_stationId, + in template (value) VruAwareness p_vam + ) := { + header := { + protocolVersion := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_protocolVersion_currentVersion_, + messageId := LibItsCommon_ASN1_NamedNumbers.ItsPduHeader_messageId_vru_, + stationId := p_stationId + }, + vam := p_vam + } + + /** + * @desc Default Receive template for VAM PDU + */ + template (present) VAM mw_vamMsg( + template (present) VruAwareness p_vam := ? + ) modifies mw_vamMsg_any := { + vam := p_vam + } + template (value) VruAwareness m_vru_awareness( in template (value) GenerationDeltaTime p_generation_delta_time, in template (value) VamParameters p_vam_parameters @@ -338,4 +370,31 @@ module LibItsVru_Templates { stabilityChangeIndication := p_stability_change_indication } + template (value) ReferencePositionWithConfidence m_reference_position( + in UInt32 p_latitude, + in UInt32 p_longitude + ) := { + latitude := p_latitude, + longitude := p_longitude, + positionConfidenceEllipse := { + semiMajorAxisLength := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, + semiMinorAxisLength := LibItsCommon_ASN1_NamedNumbers.SemiAxisLength_oneCentimeter_, + semiMajorAxisOrientation := LibItsCommon_ASN1_NamedNumbers.HeadingValue_wgs84North_ + }, + altitude := { + altitudeValue := LibItsCommon_ASN1_NamedNumbers.AltitudeValue_referenceEllipsoidSurface_, + altitudeConfidence := unavailable + } + } + + template (present) ReferencePositionWithConfidence mw_reference_position( + template (present) UInt32 p_latitude := ?, + template (present) UInt32 p_longitude := ? + ) := { + latitude := p_latitude, + longitude := p_longitude, + positionConfidenceEllipse := ?, + altitude := ? + } + } // End of module LibItsVru_Templates \ No newline at end of file diff --git a/lib/LibItsVru_TypesAndValues.ttcn b/lib/LibItsVru_TypesAndValues.ttcn index ba03401..068a124 100644 --- a/lib/LibItsVru_TypesAndValues.ttcn +++ b/lib/LibItsVru_TypesAndValues.ttcn @@ -20,11 +20,22 @@ module LibItsVru_TypesAndValues { variant "FIELDORDER(msb)" } + /** + * @desc + * @member setVruProfile Set VRU profile + */ + type union UtVamTrigger { + UInt8 setVruProfile + } with { + variant "" + } + /** * @desc Upper Tester results message of the VRU IUT */ type union UtVamResults { - boolean utVamInitializeResult + boolean utVamInitializeResult, + boolean utVamTriggerResult } with { variant "" } // End of type UtVamResults diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn index 7adeb2c..a952f51 100644 --- a/lib_system/LibItsVru_Functions.ttcn +++ b/lib_system/LibItsVru_Functions.ttcn @@ -13,6 +13,10 @@ module LibItsVru_Functions { import from LibItsCommon_Templates all; import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; + import from LibItsCommon_TestSystem all; + + // LibItsGeoNetworking + import from LibItsGeoNetworking_TypesAndValues all; // LibItsVru import from LibItsVru_TestSystem all; @@ -55,6 +59,33 @@ module LibItsVru_Functions { } + /** + * @desc Triggers event from the application layer + * @param p_event The event to trigger. + */ + function f_utTriggerEvent(template (value) UtVamTrigger p_event) runs on ItsVru { + + // deactivate vamPort default alts + vc_vruDefaultActive := false; + + utPort.send(p_event); + tc_wait.start; + alt { + [] utPort.receive(UtVamResults: { utVamTriggerResult := true }) { + tc_wait.stop; + } + [] utPort.receive { + tc_wait.stop; + } + [] tc_wait.timeout { + } + } + + //activate vamPort default alts + vc_vruDefaultActive := true; + + } + } // End of group utFunctions group adapterControl { @@ -176,7 +207,7 @@ module LibItsVru_Functions { function f_acAwaitTimeInRunningScenario( integer p_time, - boolean p_stopOnCamMessage := true + boolean p_stopOnVamMessage := true ) runs on ItsVru return FncRetCode { var FncRetCode v_ret := e_success; @@ -186,7 +217,7 @@ module LibItsVru_Functions { tc_ac.start(int2float(p_time)*1.1); alt { - [p_stopOnCamMessage] vamPort.check(receive(mw_vamInd ( mw_vamMsg_any ))) { + [p_stopOnVamMessage] vamPort.check(receive(mw_vamInd ( mw_vamMsg_any ))) { tc_ac.stop; } [] acPort.receive(m_acGnssTimeReachedSuccess) { @@ -206,17 +237,87 @@ module LibItsVru_Functions { } return v_ret; } // End of function f_acAwaitTimeInRunningScenario - + } // End of group adapterControl group vruConfigurationFunctions { + function f_cfMtcUp01( + out ItsVru p_vam_cluster_leader, + out ItsVru p_iut + ) runs on ItsBaseMtc { + p_vam_cluster_leader := ItsVru.create("VRU-CLUSTER_LEADER") alive; + p_iut := ItsVru.create("VRU-IUT") alive; + + connect(self:syncPort, mtc:syncPort); + connect(p_vam_cluster_leader:syncPort, self:syncPort); + connect(p_iut:syncPort, self:syncPort); + + //connect(p_vam_cluster_leader:infoPort, p_iut:infoPort); + + } // End of function f_cfMtcUp01 + + function f_cfMtcUp02( + out ItsVru p_vam_cluster_leader_1, + out ItsVru p_vam_cluster_leader_2, + out ItsVru p_iut + ) runs on ItsBaseMtc { + p_vam_cluster_leader_1 := ItsVru.create("VRU-CLUSTER_LEADER") alive; + p_vam_cluster_leader_2 := ItsVru.create("VRU-CLUSTER_LEADER") alive; + p_iut := ItsVru.create("VRU-IUT") alive; + + connect(self:syncPort, mtc:syncPort); + connect(p_vam_cluster_leader_1:syncPort, self:syncPort); + connect(p_vam_cluster_leader_2:syncPort, self:syncPort); + connect(p_iut:syncPort, self:syncPort); + + //connect(p_vam_cluster_leader:infoPort, p_iut:infoPort); + + } // End of function f_cfMtcUp02 + + function f_cfMtcDown01( + inout ItsVru p_vam_cluster_leader, + inout ItsVru p_iut + ) runs on ItsBaseMtc { + + deactivate; + + disconnect(self:syncPort, mtc:syncPort); + disconnect(p_vam_cluster_leader:syncPort, self:syncPort); + disconnect(p_iut:syncPort, self:syncPort); + + //disconnect(p_vam_cluster_leader:infoPort, p_iut:infoPort); + + p_vam_cluster_leader.done; + p_iut.done; + } + + function f_cfMtcDown02( + out ItsVru p_vam_cluster_leader_1, + out ItsVru p_vam_cluster_leader_2, + inout ItsVru p_iut + ) runs on ItsBaseMtc { + + deactivate; + + disconnect(self:syncPort, mtc:syncPort); + disconnect(p_vam_cluster_leader_1:syncPort, self:syncPort); + disconnect(p_vam_cluster_leader_2:syncPort, self:syncPort); + disconnect(p_iut:syncPort, self:syncPort); + + //disconnect(p_vam_cluster_leader:infoPort, p_iut:infoPort); + + p_vam_cluster_leader_1.done; + p_vam_cluster_leader_2.done; + p_iut.done; + } + /** * @desc Setups default configuration * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ function f_cfUp( - in charstring p_certificateId := PX_CERT_FOR_TS + in charstring p_certificateId := PX_CERT_FOR_TS ) runs on ItsVru system ItsVruSystem { map(self:utPort, system:utPort); @@ -246,6 +347,75 @@ module LibItsVru_Functions { } // End of function f_cfDown + /** + * @desc Setups default configuration + * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT + */ + function f_cfUp_cluster_leader() runs on ItsVru system ItsVruSystem { + + map(self:utPort, system:utPort); + map(self:acPort, system:acPort); + map(self:vamPort, system:vamPort); + f_connect4SelfOrClientSync(); + + // Initialise secured mode + f_initialiseSecuredMode(); + + } // End of function f_cfUp_cluster_leader + + /** + * @desc Deletes default configuration + */ + function f_cfDown_cluster_leader() runs on ItsVru system ItsVruSystem { + deactivate; + + // Initialise secured mode + f_uninitialiseSecuredMode(); + + unmap(self:vamPort, system:vamPort); + + f_acStopScenario(); + unmap(self:utPort, system:utPort); + unmap(self:acPort, system:acPort); + f_disconnect4SelfOrClientSync(); + + } // End of function f_cfDown_cluster_leader + + /** + * @desc Setups default configuration + */ + function f_cfUp_iut() runs on ItsVru system ItsVruSystem { + + map(self:utPort, system:utPort); + map(self:acPort, system:acPort); + map(self:vamPort, system:vamPort); + f_connect4SelfOrClientSync(); + + // Initialise secured mode + f_initialiseSecuredMode(); + + f_prInitialState(); + + } // End of function f_cfUp_iut + + /** + * @desc Deletes default configuration + */ + function f_cfDown_iut() runs on ItsVru system ItsVruSystem { + deactivate; + + // Initialise secured mode + f_uninitialiseSecuredMode(); + + unmap(self:vamPort, system:vamPort); + + f_acStopScenario(); + unmap(self:utPort, system:utPort); + unmap(self:acPort, system:acPort); + f_disconnect4SelfOrClientSync(); + + } // End of function f_cfDown_iut + } // End of vruConfigurationFunctions group defaults { @@ -375,5 +545,5 @@ module LibItsVru_Functions { } } // End of group postambles - + } // End of module LibItsVru_Functions \ No newline at end of file diff --git a/lib_system/LibItsVru_TestSystem.ttcn b/lib_system/LibItsVru_TestSystem.ttcn index 58692eb..2eaecf0 100644 --- a/lib_system/LibItsVru_TestSystem.ttcn +++ b/lib_system/LibItsVru_TestSystem.ttcn @@ -31,7 +31,7 @@ module LibItsVru_TestSystem language "TTCN-3:2010 Real Time and Performance Test */ type port UpperTesterPort message { out - UtVamInitialize; + UtVamInitialize, UtVamTrigger; in UtVamResults, UtVamEventInd; } // end UpperTesterPort -- GitLab From 091299e5c7c573f567025b857b115c0b77d72a00 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 13 Feb 2025 11:15:54 +0100 Subject: [PATCH 09/20] Add functions to initiate and create a cluster --- ItsVru_TestCases.ttcn | 409 +++++++++- ItsVru_TpFunctions.ttcn | 1600 ++++++++++++++++++------------------- lib/LibItsVru_Pixits.ttcn | 4 +- 3 files changed, 1200 insertions(+), 813 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index c2f0b53..58c0716 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -553,7 +553,7 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_leader, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_15_iut()); // Synchronization @@ -608,7 +608,7 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_leader, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_16_cluster_leader()); + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_16_iut()); // Synchronization @@ -667,7 +667,7 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_leader, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_17_cluster_leader()); + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_17_iut()); // Synchronization @@ -726,7 +726,7 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_leader, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_18_cluster_leader()); + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_18_iut()); // Synchronization @@ -786,7 +786,7 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_leader, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_19_cluster_leader()); + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_19_iut()); // Synchronization @@ -847,7 +847,7 @@ module ItsVru_TestCases { f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); // Start components - v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_20_cluster_leader_1()); + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_20_cluster_leader_2()); v_iut.start(f_TC_VBS_MSGF_BV_20_iut()); @@ -859,6 +859,236 @@ module ItsVru_TestCases { } // End of testcase TC_VBS_MSGF_BV_20 + /** + * @desc Check that clusterLeaveReason indicates CancelledJoin when the joining is cancelled + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VBS has started joining the cluster
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VBS has received a VAM from a cluster leader
+     *              containing vruClusterInformationContainer
+     *                  containing clusterCardinalitySize
+     *                      indicating value > maxClusterSize
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating CancelledJoin (6)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-21 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_21() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_21_cluster_leader()); // Initiate the cluster + v_iut.start(f_TC_VBS_MSGF_BV_21_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_21 + + /** + * @desc Check that clusterLeaveReason indicates FailedJoin when the joining is cancelled + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VBS has started joining the cluster
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VBS has received a VAM from a cluster leader
+     *              containing vruClusterInformationContainer
+     *                  containing clusterCardinalitySize
+     *                      indicating value > maxClusterSize
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating FailedJoin (7)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-22 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_22() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_21_cluster_leader()); // FIXME Seems to be identical to TP/VBS/MSGF/BV-21 + v_iut.start(f_TC_VBS_MSGF_BV_21_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_22 + + /** + * @desc Check that clusterLeaveReason indicates SafetyCondition when another cluster VRU comes too close + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          another VRU in the cluster has come closer than MSLaD laterally
+     *          and another VRU in the cluster has come closer than MSLoD longitudinally
+     *          and another VRU in the cluster has come closer than MSVD vertically
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterLeaveReason
+     *                              indicating SafetyCondition (8)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-23 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_23() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader_1; + var ItsVru v_vam_cluster_leader_2; // To trigger SafetyCondition error + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + + // Start components + // TODO + /*v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_23_cluster_approching()); + v_iut.start(f_TC_VBS_MSGF_BV_23_iut());*/ + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_23 + + /** + * @desc Check that clusterBreakupReason indicates clusteringPurposeCompleted when the clustering purpose is completed + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          the clustering purpose is completed
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterInformationContainer
+     *                      containing clusterId
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterBreakupInfo
+     *                          indicating clusteringPurposeCompleted (1)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-24 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_24() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_24_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_24_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_24 + @@ -917,6 +1147,173 @@ module ItsVru_TestCases { + /** + * @desc Check that the VruMotionPredictionContainer includes the pathHistory of type PathHistory consisting of up to 40 past points + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has n PathPoints
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruMotionPredictionContainer
+     *                      containing pathHistory
+     *                          containing n <= 40 PathPoints
+     *                              containing pathPosition
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-31 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 + */ + testcase TC_VBS_MSGF_BV_31() runs on ItsBaseMtc system ItsVruSystem { + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_31_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + } // End of TC_VBS_MSGF_BV_31 + + /** + * @desc Check that the VruMotionPredictionContainer includes the path prediction of type PathPredicted consisting of up to 15 future points, confidence values and time instances + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has n VruPathPoints
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruMotionPredictionContainer
+     *                      containing pathPrediction
+     *                          containing n <= 15 times PathPointPredicted
+     *                              containing horizontalPositionConfidence
+     *                              and containing pathDeltaTime
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-32 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 + */ + testcase TC_VBS_MSGF_BV_32() runs on ItsBaseMtc system ItsVruSystem { + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_32_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + } // End of TC_VBS_MSGF_BV_32 + + /** + * @desc Check that the vruMotionPredictionContainer includes the safe distance indication that includes timeToCollision + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU has detected a possible collision
+     *         and VRU has timeToCollision of TTC
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing VruMotionPredictionContainer
+     *                      containing safeDistance
+     *                          containing VruSafeDistanceIndication
+     *                              containing timeToCollision
+     *                                  indicating value TTC
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-33 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 + */ + testcase TC_VBS_MSGF_BV_33() runs on ItsBaseMtc system ItsVruSystem { + var ItsVru v_vam_cluster_leader_1; + var ItsVru v_vam_cluster_leader_2; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + + // Start components + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_33_cluster_approching()); + v_iut.start(f_TC_VBS_MSGF_BV_33_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + } // End of TC_VBS_MSGF_BV_33 + diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index b5b7279..b200bdf 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -31,6 +31,346 @@ module ItsVru_TpFunctions { import from LibItsSecurity_Functions all; + group LibHelpers_Functions { + + type record of PathPointPredicted UnrestritedPathPointPredicted; + function f_generate_path_history( + in integer p_num_points, + in VAM p_first_iut_vam, + out PathHistory p_path_history, + out PathPredicted p_path_predicted + ) runs on ItsVru { + var VamParameters v_vam_parameters := p_first_iut_vam.vam.vamParameters; + var UnrestritedPathPointPredicted v_path_predicted; + + // Initialize the path history + p_path_history := {}; + v_path_predicted := {}; + // Populate it with points based on IUT position + for (var integer i := 0; i < p_num_points; i := i + 1) { // From the most recent pint to the oldest one + p_path_history[i] := valueof( + m_path_point( + m_delta_reference_position( + PX_DELTA_LATITUDE_IN_BOX + i, // TODO To be refined + PX_DELTA_LONGITUDE_IN_BOX, + 0 + ), + 1 + )); + v_path_predicted[i] := valueof( + m_path_point_predicted( + PX_DELTA_LATITUDE_IN_BOX + i, // TODO To be refined + PX_DELTA_LONGITUDE_IN_BOX + + )); + } // End of 'for'statement + p_path_predicted := v_path_predicted; + + } // End of function f_generate_path_history + + /** + * @desc Set the IUT in VRU-ACTIVE-CLUSTER-LEADER mode + */ + function f_create_cluster_iut_as_leader(out VAM p_vam) runs on ItsVru { + + } // End of function f_create_cluster_iut_as_leader + + /** + * @desc Set the IUT in VRU-PASSIVE mode + */ + function f_create_cluster_iut_as_member( + out VAM p_first_iut_vam, // FIXME Seems to be useless + out VAM p_updated_cluster_vam, + in Identifier1B p_vru_cluster_create_id := PX_VRU_CLUSTER_CREATE_ID + ) runs on ItsVru return boolean { + + // Local variables + var VamInd v_vam; + var VamParameters v_vam_parameters; + + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_vam { + tc_ac.stop; + p_first_iut_vam := v_vam.msgIn; + v_vam_parameters := v_vam.msgIn.vam.vamParameters; + + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + return false; + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, closed position, same direction) + p_updated_cluster_vam := valueof( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + p_vru_cluster_create_id, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )))))); + f_generate_path_history( + 10, + p_first_iut_vam, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + ); + vamPort.send(m_vruReq(p_updated_cluster_vam)); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + p_vru_cluster_create_id + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + return false; + } + } // End of 'alt' statement + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + f_generate_path_history( + 12, + p_first_iut_vam, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + ); + p_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof( + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + 1, + p_vru_cluster_create_id, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + ))); + vamPort.send(m_vruReq(p_updated_cluster_vam)); + log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***"); + + return true; + } // End of function f_create_cluster_iut_as_member + + /** + * @desc Initiate a cluster with error + */ + function f_initiate_cluster_iut_as_member( + in template (value) VruClusterOperationContainer p_vru_cluster_operation_container, + out VAM p_first_iut_vam, // FIXME Seems to be useless + out VAM p_updated_cluster_vam + ) runs on ItsVru return boolean { + + // Local variables + var VamInd v_vam; + var VamParameters v_vam_parameters; + + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_vam { + tc_ac.stop; + p_first_iut_vam := v_vam.msgIn; + v_vam_parameters := v_vam.msgIn.vam.vamParameters; + + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + return false; + } + } // End of 'alt' statement + // Send VA message covering condition to join the cluster (similar speed, closed position, same direction) + p_updated_cluster_vam := valueof( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )))))); + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); + f_generate_path_history( + 10, + p_first_iut_vam, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + ); + vamPort.send(m_vruReq(p_updated_cluster_vam)); + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to join the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container, + m_vru_cluster_operation_container( + mw_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + return false; + } + } // End of 'alt' statement + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + f_generate_path_history( + 12, + p_first_iut_vam, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + ); + p_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof( + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + 1, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + ))); + p_updated_cluster_vam.vam.vamParameters.vruClusterOperationContainer := valueof(p_vru_cluster_operation_container); + vamPort.send(m_vruReq(p_updated_cluster_vam)); + log("*** " & testcasename() & ": INFO: VAM cluster creation failure and existing ***"); + + return true; + } // End of function f_initiate_cluster_iut_as_member + + function f_terminate_cluster(in VAM p_vam) runs on ItsVru { + p_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + p_vam.vam.vamParameters.vruClusterOperationContainer := valueof( + m_vru_cluster_operation_container( + -, -, + m_cluster_breakup_info( + PX_VRU_CLUSTER_BREAKUP_REASON + ))); + vamPort.send(m_vruReq(p_vam)); + log("*** " & testcasename() & ": INFO: VAMcluster deleted***"); + } // End of function f_terminate_cluster + + } // End of group LibHelpers_Functions + group message_format { /** @@ -778,8 +1118,8 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_15_cluster_leader() runs on ItsVru system ItsVruSystem { // Local variables - var VamInd v_fisrt_vam; - var VamParameters v_vam_parameters; + var VAM v_fisrt_vam; + var VAM v_cluster_vam; // Test control @@ -789,168 +1129,23 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble - // Wait for first VA message from the IUT - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, close position, same direction) - v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.curvature, - v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, - v_vam_parameters.vruHighFrequencyContainer.yawRate, - v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, - v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, - v_vam_parameters.vruHighFrequencyContainer.environment, - v_vam_parameters.vruHighFrequencyContainer.movementControl, - v_vam_parameters.vruHighFrequencyContainer.orientation, - v_vam_parameters.vruHighFrequencyContainer.rollAngle, - v_vam_parameters.vruHighFrequencyContainer.deviceUsage - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - )), - m_vru_cluster_operation_container( - m_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))); - log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); - // Wait for the IUT to join the cluster - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, -, - mw_vru_cluster_information_container, - m_vru_cluster_operation_container( - mw_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))) { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Set the UIT in VRU-PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + // Test Body f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - - ))))))); + vamPort.send(m_vruReq(v_cluster_vam)); log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble // Delete the cluster - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, -, - m_vru_cluster_operation_container( - m_cluster_breakup_info( - PX_VRU_CLUSTER_BREAKUP_REASON - ))))))); + f_terminate_cluster(v_cluster_vam); log("*** " & testcasename() & ": INFO: VAM cluster deleted ***"); f_poDefault(); f_cfDown_cluster_leader(); @@ -1008,156 +1203,30 @@ module ItsVru_TpFunctions { group f_TC_VBS_MSGF_BV_16 { - function f_TC_VBS_MSGF_BV_16_cluster_leader() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_16_iut() runs on ItsVru system ItsVruSystem { // Local variables - var VamInd v_fisrt_vam; - var VamParameters v_vam_parameters; - + // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_iut(); // Test adapter configuration // Preamble - // Wait for first VA message from the IUT + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, close position, same direction) - v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.curvature, - v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, - v_vam_parameters.vruHighFrequencyContainer.yawRate, - v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, - v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, - v_vam_parameters.vruHighFrequencyContainer.environment, - v_vam_parameters.vruHighFrequencyContainer.movementControl, - v_vam_parameters.vruHighFrequencyContainer.orientation, - v_vam_parameters.vruHighFrequencyContainer.rollAngle, - v_vam_parameters.vruHighFrequencyContainer.deviceUsage - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - )), - m_vru_cluster_operation_container( - m_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))); - log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); - // Wait for the IUT to join the cluster - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, -, - mw_vru_cluster_information_container, - m_vru_cluster_operation_container( - mw_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))) { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - - // Test Body - // Do not send VAM anynore - tc_ac.start; - alt { - [] tc_ac.timeout { - log("*** " & testcasename() & ": PASS: No more VAM sent ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - } // End of 'alt' statement - - // Postamble - f_poDefault(); - f_cfDown_cluster_leader(); - - } - - function f_TC_VBS_MSGF_BV_16_iut() runs on ItsVru system ItsVruSystem { - // Local variables - - // Test control - - // Test component configuration - f_cfUp_iut(); - - // Test adapter configuration - - // Preamble - f_prInitialState(); - // Wait for the cluster creation - // Join the cluster - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - -, + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, mw_vam_parameters( -, -, -, -, mw_vru_cluster_operation_container( @@ -1186,198 +1255,6 @@ module ItsVru_TpFunctions { group f_TC_VBS_MSGF_BV_17 { - function f_TC_VBS_MSGF_BV_17_cluster_leader() runs on ItsVru system ItsVruSystem { - // Local variables - var VamInd v_fisrt_vam; - var VamParameters v_vam_parameters; - - // Test control - - // Test component configuration - f_cfUp_cluster_leader(); - - // Test adapter configuration - - // Preamble - // Wait for first VA message from the IUT - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, close position, same direction) - v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.curvature, - v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, - v_vam_parameters.vruHighFrequencyContainer.yawRate, - v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, - v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, - v_vam_parameters.vruHighFrequencyContainer.environment, - v_vam_parameters.vruHighFrequencyContainer.movementControl, - v_vam_parameters.vruHighFrequencyContainer.orientation, - v_vam_parameters.vruHighFrequencyContainer.rollAngle, - v_vam_parameters.vruHighFrequencyContainer.deviceUsage - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - )), - m_vru_cluster_operation_container( - m_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))); - log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); - // Wait for the IUT to join the cluster - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, -, - mw_vru_cluster_information_container, - m_vru_cluster_operation_container( - mw_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))) { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - - // Test Body - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - - ))))))); - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster is disbanded - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - )), - m_vru_cluster_operation_container( - -, - m_cluster_leave_info( - Vru_clusterLeaveReason_clusterDisbandedByLeader) - - )))))); - log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - // Postamble - f_poDefault(); - f_cfDown_cluster_leader(); - } - function f_TC_VBS_MSGF_BV_17_iut() runs on ItsVru system ItsVruSystem { // Local variables @@ -1430,193 +1307,59 @@ module ItsVru_TpFunctions { group f_TC_VBS_MSGF_BV_18 { - function f_TC_VBS_MSGF_BV_18_cluster_leader() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_18_iut() runs on ItsVru system ItsVruSystem { // Local variables - var VamInd v_fisrt_vam; - var VamParameters v_vam_parameters; // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_iut(); // Test adapter configuration // Preamble - // Wait for first VA message from the IUT - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, close position, same direction) - v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.curvature, - v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, - v_vam_parameters.vruHighFrequencyContainer.yawRate, - v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, - v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, - v_vam_parameters.vruHighFrequencyContainer.environment, - v_vam_parameters.vruHighFrequencyContainer.movementControl, - v_vam_parameters.vruHighFrequencyContainer.orientation, - v_vam_parameters.vruHighFrequencyContainer.rollAngle, - v_vam_parameters.vruHighFrequencyContainer.deviceUsage - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - )), - m_vru_cluster_operation_container( - m_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))); - log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); - // Wait for the IUT to join the cluster + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, mw_vam_parameters( - -, -, -, - mw_vru_cluster_information_container, - m_vru_cluster_operation_container( - mw_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))) { + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_outOfClusterBoundingBox + ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - - // Test Body - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - - ))))))); - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence, with important distance - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_OUT_OF_BOX, - v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_OUT_OF_BOX, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - ))))))); - log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble + // Leave the cluster f_poDefault(); - f_cfDown_cluster_leader(); - } + f_cfDown_iut(); - function f_TC_VBS_MSGF_BV_18_iut() runs on ItsVru system ItsVruSystem { + } // End of function f_TC_VBS_MSGF_BV_18_iut + + } // End of group f_TC_VBS_MSGF_BV_18 + + group f_TC_VBS_MSGF_BV_19 { + + function f_TC_VBS_MSGF_BV_19_iut() runs on ItsVru system ItsVruSystem { // Local variables // Test control @@ -1645,7 +1388,7 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, mw_cluster_leave_info( - Vru_clusterLeaveReason_outOfClusterBoundingBox + Vru_clusterLeaveReason_outOfClusterSpeedRange ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); @@ -1662,13 +1405,13 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown_iut(); - } // End of function f_TC_VBS_MSGF_BV_18_iut + } // End of function f_TC_VBS_MSGF_BV_19_iut - } // End of group f_TC_VBS_MSGF_BV_18 + } // End of group f_TC_VBS_MSGF_BV_19 - group f_TC_VBS_MSGF_BV_19 { + group f_TC_VBS_MSGF_BV_20 { - function f_TC_VBS_MSGF_BV_19_cluster_leader() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_20_cluster_leader_2() runs on ItsVru system ItsVruSystem { // Local variables var VamInd v_fisrt_vam; var VamParameters v_vam_parameters; @@ -1681,6 +1424,8 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble + // Wait for the IUT joining a fisrt cluster before to send a a join cluster better that the previous one + f_sleep(PX_TNOAC); // Wait for first VA message from the IUT tc_ac.start; alt { @@ -1701,7 +1446,7 @@ module ItsVru_TpFunctions { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + // Send VA message covering condition to join the cluster (similar speed, closed position, same direction) v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; vamPort.send( m_vruReq( @@ -1713,15 +1458,15 @@ module ItsVru_TpFunctions { m_basic_container( StationType_bus_, m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, - v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, @@ -1741,7 +1486,7 @@ module ItsVru_TpFunctions { m_vru_cluster_information_container( m_vru_cluster_information( PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, + PX_VRU_CLUSTER_CREATE_ID + 1, m_shape_circular( m_circular_shape( PX_VRU_CLUSTER_CREATE_RADIUS @@ -1780,7 +1525,7 @@ module ItsVru_TpFunctions { // Test Body f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence and a speed such as abs(SPEED_2 - SPEED_1) > maxClusterVelocityDifference + // Cluster leader send a VA message to indicate the cluster presence vamPort.send( m_vruReq( m_vamMsg( @@ -1798,17 +1543,14 @@ module ItsVru_TpFunctions { )), m_vru_high_frequency_container( v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), + v_vam_parameters.vruHighFrequencyContainer.speed, v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, m_vru_cluster_information_container( m_vru_cluster_information( PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID, + PX_VRU_CLUSTER_CREATE_ID + 1, m_shape_circular( m_circular_shape( PX_VRU_CLUSTER_CREATE_RADIUS @@ -1816,6 +1558,94 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_PROFILE ))))))); + log("*** " & testcasename() & ": PASS: VAM better cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_MSGF_BV_20_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + mw_cluster_join_info( + ? // FIXME FSCOM Set the correct cluster id + ), + mw_cluster_leave_info( + Vru_clusterLeaveReason_joiningAnotherCluster + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_20_iut + + } // End of group f_TC_VBS_MSGF_BV_20 + + group f_TC_VBS_MSGF_BV_21 { // FIXME To be reviewed + + function f_TC_VBS_MSGF_BV_21_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Wait for first VA message from the IUT + f_initiate_cluster_iut_as_member( + m_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_cancelledJoin + )), + v_fisrt_vam, + v_cluster_vam + ); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); @@ -1824,7 +1654,7 @@ module ItsVru_TpFunctions { f_cfDown_cluster_leader(); } - function f_TC_VBS_MSGF_BV_19_iut() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_21_iut() runs on ItsVru system ItsVruSystem { // Local variables // Test control @@ -1870,13 +1700,13 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown_iut(); - } // End of function f_TC_VBS_MSGF_BV_19_iut + } // End of function f_TC_VBS_MSGF_BV_21_iut - } // End of group f_TC_VBS_MSGF_BV_19 + } // End of group f_TC_VBS_MSGF_BV_21 - group f_TC_VBS_MSGF_BV_20 { + group f_TC_VBS_MSGF_BV_24 { - function f_TC_VBS_MSGF_BV_20_cluster_leader_1() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_24_cluster_leader() runs on ItsVru system ItsVruSystem { // Local variables var VamInd v_fisrt_vam; var VamParameters v_vam_parameters; @@ -1909,7 +1739,7 @@ module ItsVru_TpFunctions { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, close position, same direction) + // Send VA message covering condition to join the cluster (similar speed, closed position, same direction) v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; vamPort.send( m_vruReq( @@ -1988,7 +1818,7 @@ module ItsVru_TpFunctions { // Test Body f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence + // Cluster leader send a VA message to indicate the cluster presence and cluseter completed vamPort.send( m_vruReq( m_vamMsg( @@ -2006,13 +1836,16 @@ module ItsVru_TpFunctions { )), m_vru_high_frequency_container( v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, m_vru_cluster_information_container( m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, + PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, PX_VRU_CLUSTER_CREATE_ID, m_shape_circular( m_circular_shape( @@ -2021,51 +1854,7 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_PROFILE ))))))); - log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - // Postamble - f_poDefault(); - f_cfDown_cluster_leader(); - } - - function f_TC_VBS_MSGF_BV_20_cluster_leader_2() runs on ItsVru system ItsVruSystem { - // Local variables - var VamInd v_fisrt_vam; - var VamParameters v_vam_parameters; - - // Test control - - // Test component configuration - f_cfUp_cluster_leader(); - - // Test adapter configuration - - // Preamble - // Wait for the IUT joining a fisrt cluster before to send a a join cluster better that the previous one f_sleep(PX_TNOAC); - // Wait for first VA message from the IUT - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, close position, same direction) - v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; vamPort.send( m_vruReq( m_vamMsg( @@ -2084,27 +1873,16 @@ module ItsVru_TpFunctions { m_vru_high_frequency_container( v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue, + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.curvature, - v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, - v_vam_parameters.vruHighFrequencyContainer.yawRate, - v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, - v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, - v_vam_parameters.vruHighFrequencyContainer.environment, - v_vam_parameters.vruHighFrequencyContainer.movementControl, - v_vam_parameters.vruHighFrequencyContainer.orientation, - v_vam_parameters.vruHighFrequencyContainer.rollAngle, - v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, m_vru_cluster_information_container( m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID + 1, + PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, + PX_VRU_CLUSTER_CREATE_ID, m_shape_circular( m_circular_shape( PX_VRU_CLUSTER_CREATE_RADIUS @@ -2112,71 +1890,12 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_PROFILE )), m_vru_cluster_operation_container( - m_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))); - log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); - // Wait for the IUT to join the cluster - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( - f_getIutStationId(), - mw_vam_parameters( - -, -, -, - mw_vru_cluster_information_container, - m_vru_cluster_operation_container( - mw_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))) { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - - // Test Body - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID + 1, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE + -, -, + m_cluster_breakup_info( + PX_VRU_CLUSTER_BREAKUP_REASON ))))))); - log("*** " & testcasename() & ": PASS: VAM better cluster created and existing ***"); + log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble @@ -2184,7 +1903,7 @@ module ItsVru_TpFunctions { f_cfDown_cluster_leader(); } - function f_TC_VBS_MSGF_BV_20_iut() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_24_iut() runs on ItsVru system ItsVruSystem { // Local variables // Test control @@ -2211,9 +1930,10 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, -, mw_vru_cluster_operation_container( - -, - mw_cluster_leave_info( - Vru_clusterLeaveReason_joiningAnotherCluster + -, -, + m_cluster_breakup_info( + PX_VRU_CLUSTER_BREAKUP_REASON + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); @@ -2230,9 +1950,9 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown_iut(); - } // End of function f_TC_VBS_MSGF_BV_20_iut + } // End of function f_TC_VBS_MSGF_BV_24_iut - } // End of group f_TC_VBS_MSGF_BV_20 + } // End of group f_TC_VBS_MSGF_BV_24 @@ -2258,9 +1978,277 @@ module ItsVru_TpFunctions { + group f_TC_VBS_MSGF_BV_31 { + /** + * @desc TP Function for TC_VBS_MSGF_BV_31 + */ + function f_TC_VBS_MSGF_BV_31_iut() runs on ItsVru { + // Local variables + var VamInd v_fisrt_vam, v_vam; + + // Test control + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + // Preamble + f_prInitialState(); + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + mw_vru_motion_prediction_container(?) + ))))) -> value v_fisrt_vam{ + tc_ac.stop; + + log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + mw_vru_motion_prediction_container(?) + ))))) -> value v_vam { + tc_ac.stop; + + if (lengthof(v_fisrt_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory) < lengthof(v_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory)) { + log("*** " & testcasename() & ": PASS: VAM containing VruMotionPredictionContainer value received with increased number of PathHistory ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } else { + log("*** " & testcasename() & ": FAIL: Invalid number of PathPoint in PathHistory ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_31_iut + + } // End of group f_TC_VBS_MSGF_BV_31 + + group f_TC_VBS_MSGF_BV_32 { + + /** + * @desc TP Function for TC_VBS_MSGF_BV_32 + */ + function f_TC_VBS_MSGF_BV_32_iut() runs on ItsVru { + // Local variables + var VamInd v_fisrt_vam, v_vam; + + // Test control + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + mw_vru_motion_prediction_container( + -, + ? + )))))) -> value v_fisrt_vam{ + tc_ac.stop; + + log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + mw_vru_motion_prediction_container(?) + ))))) -> value v_vam { + tc_ac.stop; + + if (lengthof(v_fisrt_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory) < lengthof(v_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory)) { + log("*** " & testcasename() & ": PASS: VAM containing VruMotionPredictionContainer value received with increased number of PathHistory ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } else { + log("*** " & testcasename() & ": FAIL: Invalid number of PathPoint in PathHistory ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_32_iut + + } // End of group f_TC_VBS_MSGF_BV_32 + + group f_TC_VBS_MSGF_BV_33 { + + /** + * @desc TP Function for TC_VBS_MSGF_BV_33 + */ + function f_TC_VBS_MSGF_BV_33_cluster_approching() runs on ItsVru { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Set the UIT in VRU-PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam, PX_VRU_CLUSTER_CREATE_ID + 1) == false) { // Use a different cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + vamPort.send(m_vruReq(v_cluster_vam)); + log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + // Delete the cluster + f_terminate_cluster(v_cluster_vam); + log("*** " & testcasename() & ": INFO: VAM cluster deleted ***"); + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_33_cluster_approching + + /** + * @desc TP Function for TC_VBS_MSGF_BV_33 + */ + function f_TC_VBS_MSGF_BV_33_iut() runs on ItsVru { + // Local variables + var VamInd v_fisrt_vam, v_vam; + + // Test control + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + mw_vru_motion_prediction_container( + -, + ? + )))))) -> value v_fisrt_vam{ + tc_ac.stop; + + log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + mw_vru_motion_prediction_container( + -, -, + { + *, + mw_safe_distance_indication(-, -, ?), + * + } + )))))) -> value v_vam { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: VAM containing VruMotionPredictionContainer value received with increased number of PathHistory ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_MSGF_BV_33_iut + + } // End of group f_TC_VBS_MSGF_BV_33 diff --git a/lib/LibItsVru_Pixits.ttcn b/lib/LibItsVru_Pixits.ttcn index d784b72..2d4aded 100644 --- a/lib/LibItsVru_Pixits.ttcn +++ b/lib/LibItsVru_Pixits.ttcn @@ -19,7 +19,7 @@ module LibItsVru_Pixits { modulepar StandardLength12b PX_VRU_CLUSTER_CREATE_RADIUS := 30; // 3 meters - modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE := '0000'B; // At least on pedestrian + modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE := '0000'B; // At least one pedestrian modulepar ClusterBreakupReason PX_VRU_CLUSTER_BREAKUP_REASON := Vru_ClusterBreakupReason_clusteringPurposeCompleted; @@ -35,4 +35,6 @@ module LibItsVru_Pixits { modulepar UInt32 PX_DELTA_SPEED_OUT_OF_BOX := 20; + modulepar UInt32 PX_DELTA_CARDINALITY_CANCEL := 100; + } // End of module LibItsVru_Pixits \ No newline at end of file -- GitLab From 2b92e937f800184264b545e9a27510e48813d375 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 26 Feb 2025 15:31:26 +0100 Subject: [PATCH 10/20] Implement function f_create_cluster_iut_as_leader --- ItsVru_TestCases.ttcn | 64 ++++- ItsVru_TpFunctions.ttcn | 502 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 545 insertions(+), 21 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index 58c0716..e5a5db9 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -1021,10 +1021,9 @@ module ItsVru_TestCases { f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); // Start components - // TODO - /*v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_23_cluster_approching()); - v_iut.start(f_TC_VBS_MSGF_BV_23_iut());*/ + v_iut.start(f_TC_VBS_MSGF_BV_23_iut()); // Synchronization f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); @@ -1089,6 +1088,65 @@ module ItsVru_TestCases { } // End of testcase TC_VBS_MSGF_BV_24 + /** + * @desc Check that clusterBreakupReason indicates clusteringPurposeCompleted when the clustering purpose is completed + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          the clustering purpose is completed
+     *          and VRU has sent a cluster VAM
+     *              containing vruClusterInformationContainer
+     *                  containing clusterBoundingBoxShape
+     *                      indicating Shape S
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterInformationContainer
+     *                      containing clusterId
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterBreakupInfo
+     *                          indicating leaderMovedOutOfClusterBoundingBox (2)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-25 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_25() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_25_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_25_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of testcase TC_VBS_MSGF_BV_25 + diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index b200bdf..7801c4d 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -71,8 +71,201 @@ module ItsVru_TpFunctions { /** * @desc Set the IUT in VRU-ACTIVE-CLUSTER-LEADER mode */ - function f_create_cluster_iut_as_leader(out VAM p_vam) runs on ItsVru { + function f_create_cluster_iut_as_leader( + out VAM p_first_iut_vam, // FIXME Seems to be useless + out VAM p_updated_cluster_vam, + in Identifier1B p_vru_cluster_create_id := PX_VRU_CLUSTER_CREATE_ID + ) runs on ItsVru return boolean { + + // Local variables + var VamInd v_vam; + var VAM v_updated_cluster_vam; + var VamParameters v_vam_parameters; + + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container + ))))) -> value v_vam { + tc_ac.stop; + p_first_iut_vam := v_vam.msgIn; + v_vam_parameters := v_vam.msgIn.vam.vamParameters; + + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + return false; + } + } // End of 'alt' statement + + // Send x VAM with conditions to create a cluster and wait for the cluster creation + v_updated_cluster_vam := valueof( + m_vamMsg( + 0, // Updated before to be sent + m_vru_awareness( + 0, // Updated before to be sent + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY, + p_vru_cluster_create_id, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )))))); + f_generate_path_history( + 10, + p_first_iut_vam, + v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + ); + for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) { + v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i; + v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + vamPort.send(m_vruReq(v_updated_cluster_vam)); + f_sleep(1.0); + } // End of 'for' statement + log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); + // Wait for the IUT to create the cluster + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + f_getIutStationId(), + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container( + mw_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + 1 + ))))))) -> value v_vam{ + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT created the cluster ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); + return false; + } + } // End of 'alt' statement + // Join the cluster + v_vam_parameters := v_vam.msgIn.vam.vamParameters; + v_updated_cluster_vam := valueof( + m_vamMsg( + 0, // Updated before to be sent + m_vru_awareness( + 0, // Updated before to be sent + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, + v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer, + m_vru_cluster_operation_container( + m_cluster_join_info( + v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId + )))))); + f_generate_path_history( + 10, + p_first_iut_vam, + v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + ); + for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) { + v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i; + v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + vamPort.send(m_vruReq(v_updated_cluster_vam)); + f_sleep(1.0); + } // End of 'for' statement + + // Cluster leader send a VA message to indicate the cluster presence + v_updated_cluster_vam.header.stationId := f_getTsStationId(); + v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + f_generate_path_history( + 12, + p_first_iut_vam, + v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + ); + v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof( + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + 1, + p_vru_cluster_create_id, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + ))); + v_updated_cluster_vam.vam.vamParameters.vruClusterOperationContainer := omit; + vamPort.send(m_vruReq(v_updated_cluster_vam)); + log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***"); + + return true; } // End of function f_create_cluster_iut_as_leader /** @@ -188,7 +381,6 @@ module ItsVru_TpFunctions { } } // End of 'alt' statement - // Test Body f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; @@ -316,7 +508,7 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, mw_vru_cluster_information_container, - m_vru_cluster_operation_container( + mw_vru_cluster_operation_container( mw_cluster_join_info( PX_VRU_CLUSTER_CREATE_ID ))))))) { @@ -329,7 +521,6 @@ module ItsVru_TpFunctions { } } // End of 'alt' statement - // Test Body f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; @@ -352,7 +543,7 @@ module ItsVru_TpFunctions { ))); p_updated_cluster_vam.vam.vamParameters.vruClusterOperationContainer := valueof(p_vru_cluster_operation_container); vamPort.send(m_vruReq(p_updated_cluster_vam)); - log("*** " & testcasename() & ": INFO: VAM cluster creation failure and existing ***"); + log("*** " & testcasename() & ": INFO: VAM cluster creation done ***"); return true; } // End of function f_initiate_cluster_iut_as_member @@ -1201,6 +1392,9 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_MSGF_BV_15 + /** + * @desc TP Function for TC_VBS_MSGF_BV_16 + */ group f_TC_VBS_MSGF_BV_16 { function f_TC_VBS_MSGF_BV_16_iut() runs on ItsVru system ItsVruSystem { @@ -1235,7 +1429,7 @@ module ItsVru_TpFunctions { Vru_clusterLeaveReason_clusterLeaderLost ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterLeaderLost ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1253,6 +1447,9 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_MSGF_BV_16 + /** + * @desc TP Function for TC_VBS_MSGF_BV_17 + */ group f_TC_VBS_MSGF_BV_17 { function f_TC_VBS_MSGF_BV_17_iut() runs on ItsVru system ItsVruSystem { @@ -1287,7 +1484,7 @@ module ItsVru_TpFunctions { Vru_clusterLeaveReason_clusterDisbandedByLeader ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterDisbandedByLeader ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1305,6 +1502,9 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_MSGF_BV_17 + /** + * @desc TP Function for TC_VBS_MSGF_BV_18 + */ group f_TC_VBS_MSGF_BV_18 { function f_TC_VBS_MSGF_BV_18_iut() runs on ItsVru system ItsVruSystem { @@ -1339,7 +1539,7 @@ module ItsVru_TpFunctions { Vru_clusterLeaveReason_outOfClusterBoundingBox ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterBoundingBox ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1357,6 +1557,9 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_MSGF_BV_18 + /** + * @desc TP Function for TC_VBS_MSGF_BV_19 + */ group f_TC_VBS_MSGF_BV_19 { function f_TC_VBS_MSGF_BV_19_iut() runs on ItsVru system ItsVruSystem { @@ -1391,7 +1594,7 @@ module ItsVru_TpFunctions { Vru_clusterLeaveReason_outOfClusterSpeedRange ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterSpeedRange ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1409,6 +1612,9 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_MSGF_BV_19 + /** + * @desc TP Function for TC_VBS_MSGF_BV_20 + */ group f_TC_VBS_MSGF_BV_20 { function f_TC_VBS_MSGF_BV_20_cluster_leader_2() runs on ItsVru system ItsVruSystem { @@ -1600,7 +1806,7 @@ module ItsVru_TpFunctions { Vru_clusterLeaveReason_joiningAnotherCluster ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_joiningAnotherCluster ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1618,6 +1824,9 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_MSGF_BV_20 + /** + * @desc TP Function for TC_VBS_MSGF_BV_21 + */ group f_TC_VBS_MSGF_BV_21 { // FIXME To be reviewed function f_TC_VBS_MSGF_BV_21_cluster_leader() runs on ItsVru system ItsVruSystem { @@ -1633,7 +1842,6 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble - // Wait for first VA message from the IUT f_initiate_cluster_iut_as_member( m_vru_cluster_operation_container( -, @@ -1686,7 +1894,7 @@ module ItsVru_TpFunctions { Vru_clusterLeaveReason_outOfClusterSpeedRange ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterSpeedRange ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1704,9 +1912,267 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_MSGF_BV_21 + /** + * @desc TP Function for TC_VBS_MSGF_BV_23 + */ + group f_TC_VBS_MSGF_BV_23 { + + function f_TC_VBS_MSGF_BV_23_cluster_approching() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + // Set the UIT in VRU-PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence + vamPort.send(m_vruReq(v_cluster_vam)); + log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + // Delete the cluster + f_terminate_cluster(v_cluster_vam); + log("*** " & testcasename() & ": INFO: VAM cluster deleted ***"); + f_poDefault(); + f_cfDown_cluster_leader(); + + } + + function f_TC_VBS_MSGF_BV_23_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + Vru_clusterLeaveReason_safetyCondition + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_safetyCondition ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } + + } // End of group f_TC_VBS_MSGF_BV_23 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_24 + */ group f_TC_VBS_MSGF_BV_24 { function f_TC_VBS_MSGF_BV_24_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + f_create_cluster_iut_as_leader( + v_fisrt_vam, + v_cluster_vam + ); + v_vam_parameters := v_cluster_vam.vam.vamParameters; + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + f_sleep(PX_TNOAC); + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + -, -, + m_cluster_breakup_info( + Vru_ClusterBreakupReason_clusteringPurposeCompleted + + ))))))); + log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_MSGF_BV_24_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, -, + m_cluster_breakup_info( + Vru_ClusterBreakupReason_clusteringPurposeCompleted + + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing Vru_ClusterBreakupReason_clusteringPurposeCompleted ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_24_iut + + } // End of group f_TC_VBS_MSGF_BV_24 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_25 + */ + group f_TC_VBS_MSGF_BV_25 { + + function f_TC_VBS_MSGF_BV_25_cluster_leader() runs on ItsVru system ItsVruSystem { // Local variables var VamInd v_fisrt_vam; var VamParameters v_vam_parameters; @@ -1818,7 +2284,7 @@ module ItsVru_TpFunctions { // Test Body f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence and cluseter completed + // Cluster leader send a VA message to indicate the cluster presence and cluster completed vamPort.send( m_vruReq( m_vamMsg( @@ -1903,7 +2369,7 @@ module ItsVru_TpFunctions { f_cfDown_cluster_leader(); } - function f_TC_VBS_MSGF_BV_24_iut() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_25_iut() runs on ItsVru system ItsVruSystem { // Local variables // Test control @@ -1932,11 +2398,11 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, -, m_cluster_breakup_info( - PX_VRU_CLUSTER_BREAKUP_REASON + Vru_ClusterBreakupReason_leaderMovedOutOfClusterBoundingBox ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_ClusterBreakupReason_leaderMovedOutOfClusterBoundingBox ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1950,9 +2416,9 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown_iut(); - } // End of function f_TC_VBS_MSGF_BV_24_iut + } // End of function f_TC_VBS_MSGF_BV_25_iut - } // End of group f_TC_VBS_MSGF_BV_24 + } // End of group f_TC_VBS_MSGF_BV_25 -- GitLab From 612f5a9b38f4ce7219e52e73e7b269300f4928e3 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 27 Feb 2025 11:05:27 +0100 Subject: [PATCH 11/20] Implement skeleton for VAMs transmision --- ItsVru_TestCases.ttcn | 690 ++++++++++++++++++++++++++++-- ItsVru_TestControl.ttcn | 25 ++ ItsVru_TpFunctions.ttcn | 477 ++++++++++++++++++--- lib/LibItsVru_Pics.ttcn | 6 + lib/LibItsVru_Templates.ttcn | 12 + lib/LibItsVru_TypesAndValues.ttcn | 6 +- 6 files changed, 1117 insertions(+), 99 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index e5a5db9..a11949d 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -1094,17 +1094,18 @@ module ItsVru_TestCases { * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING * Initial conditions: * with { - * VBS in state VRU-ACTIVE-CLUSTER-LEADER + * VBS in state VRU-ACTIVE-CLUSTER-LEADER and + * VRU has sent a cluster VAM + * containing vruClusterInformationContainer + * containing clusterBoundingBoxShape + * indicating Shape S + * } * } * Expected behaviour: * ensure that { * when { - * the clustering purpose is completed - * and VRU has sent a cluster VAM - * containing vruClusterInformationContainer - * containing clusterBoundingBoxShape - * indicating Shape S - * } + * the IUT is alerted about new reference position value P + * and P is not inside S * then { * VAM is sent * containing VamAwarness @@ -1147,63 +1148,292 @@ module ItsVru_TestCases { } // End of testcase TC_VBS_MSGF_BV_25 + /** + * @desc Check that clusterBreakupReason indicates joiningAnotherCluster when the cluster leader is joining another cluster + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          the clustering purpose is completed
+     *          containing vruClusterInformationContainer
+     *              containing clusterId
+     *                  indicating value CId
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterInformationContainer
+     *                      containing clusterId
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterBreakupInfo
+     *                          indicating value joiningAnotherCluster (3)
+     *                      and containing clusterJoinInfo
+     *                          containing clusterId
+     *                              indicating value CId
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-26 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_26() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + // Start components + /*TODO + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_26_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_26_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + } // End of testcase TC_VBS_MSGF_BV_26 + /** + * @desc Check that clusterBreakupReason indicates enteringLowriskareaBasedonMAPs when the cluster leader is entering a low-risk area + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          a MAP is received indicating the current position is in a low risk area
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterInformationContainer
+     *                      containing clusterId
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterBreakupInfo
+     *                          indicating value enteringLowriskareaBasedonMAPs (4)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-27 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_27() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + // Start components + /*TODO + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_27_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_27_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + } // End of testcase TC_VBS_MSGF_BV_27 + /** + * @desc Check that clusterBreakupReason indicates receptionOfCPMcontainingCluster when a CPM containing a cluster is received + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          a CPM is received that contains a cluster
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterInformationContainer
+     *                      containing clusterId
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterBreakupInfo
+     *                          indicating value receptionOfCPMcontainingCluster (5)
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-28 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_28() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + // Start components + /*TODO + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_28_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_28_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + } // End of testcase TC_VBS_MSGF_BV_28 + /** + * @desc Check that clusterIdChangeTimeInfo indicates the time the cluster leader intents to change the cluster ID + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *          and VRU is changing cluster ID
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterIdChangeTimeInfo
+     *                          indicating planned ID change time
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-29 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_29() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + // Start components + /*TODO + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_29_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_29_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + } // End of testcase TC_VBS_MSGF_BV_29 + /** + * @desc Check that the ClusterLeaveReason is systematically set to 0 if the reason for breaking up or leaving the cluster cannot be matched with the other reasons (1-8) + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *          and VRU is leaving the cluster
+     *          and no other reason applicable to the given 8
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruClusterOperationContainer
+     *                      containing clusterLeaveInfo
+     *                          containing clusterId
+     *                      and containing clusterLeaveReason
+     *                          indicating value 0
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-30 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 + */ + testcase TC_VBS_MSGF_BV_30() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + // Start components + /*TODO + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_30_cluster_leader()); + v_iut.start(f_TC_VBS_MSGF_BV_30_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); - - - - - - - - - - - - - - - - - - - - - - - + } // End of testcase TC_VBS_MSGF_BV_30 /** * @desc Check that the VruMotionPredictionContainer includes the pathHistory of type PathHistory consisting of up to 40 past points @@ -1372,38 +1602,236 @@ module ItsVru_TestCases { f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); } // End of TC_VBS_MSGF_BV_33 + /** + * @desc Check that the vruMotionPredictionContainer includes the accelerationChangeIndication of type AccelerationChangeIndication containing accelOrDecel and actionDeltaTime + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU accelerates or decelerates for time period DELTA_TIME
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing  vruMotionPredictionContainer
+     *                      containing accelerationChangeIndication
+     *                      containing accelOrDecel
+     *                          indicating accelerate / decelerate
+     *                      and containing actionDeltaTime
+     *                          indicating value DELTA_TIME
 
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-34 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 + */ + testcase TC_VBS_MSGF_BV_34() runs on ItsBaseMtc system ItsVruSystem { + var ItsVru v_vam_cluster_leader_1; + var ItsVru v_vam_cluster_leader_2; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + // Start components + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_34_cluster_approching()); + v_iut.start(f_TC_VBS_MSGF_BV_34_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + } // End of TC_VBS_MSGF_BV_34 + /** + * @desc Check that the vruMotionPredictionContainer includes the headingChangeIndication of type HeadingChangeIndication containing the dircetion and actionDeltaTime + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU changes heading to direction d for a time period DELTA_TIME
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruMotionPredictionContainer
+     *                      containing headingChangeIndication
+     *                          containing direction
+     *                              indicating value d
+     *                          and containing actionDeltaTime
+     *                              indicating value DELTA_TIME
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-35 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 + */ + testcase TC_VBS_MSGF_BV_35() runs on ItsBaseMtc system ItsVruSystem { + var ItsVru v_vam_cluster_leader_1; + var ItsVru v_vam_cluster_leader_2; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + // Start components + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_35_cluster_approching()); + v_iut.start(f_TC_VBS_MSGF_BV_35_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + } // End of TC_VBS_MSGF_BV_35 + /** + * @desc Check that the vruMotionPredictionContainer includes the stabilityChangeIndication of type StabilityChangeIndication containing the lossProbability and actionDeltaTime + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU changes stability by lossProbability PL for a time period DELTA_TIME
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM generation requested
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing VamAwarness
+     *                  containing vruMotionPredictionContainer
+     *                      containing stabilityChangeIndication
+     *                          containing lossProbability
+     *                              indicating value PL
+     *                          and containing actionDeltaTime
+     *                              indicating value DELTA_TIME
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-36 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 + */ + testcase TC_VBS_MSGF_BV_36() runs on ItsBaseMtc system ItsVruSystem { + var ItsVru v_vam_cluster_leader_1; + var ItsVru v_vam_cluster_leader_2; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + // Start components + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_36_cluster_approching()); + v_iut.start(f_TC_VBS_MSGF_BV_36_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + // Cleanup + f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + } // End of TC_VBS_MSGF_BV_36 + /** + * @desc Check that profile 3 VRUs only transmit a VRU special vehicle container in the CAM instead of full VAM + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VRU in profile motorcyclist (3)
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          IUT is triggered to send awareness message
+     *      }
+     *      then {
+     *          CAM is sent 
+     *              containing specialVehicleContainer
+     *                  containing vruSpecialVehicleContainer
+     *                      containing vruSubProfileMotorcyclist
+     *                      and containing sizeClass
+     *          and no VAM is generated
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-37 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 + */ + testcase TC_VBS_MSGF_BV_37() runs on ItsBaseMtc system ItsVruSystem { + var ItsVru v_vam_cluster_leader_1; + var ItsVru v_vam_cluster_leader_2; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + // Start components + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + /*TODO v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_37_cluster_approching()); + v_iut.start(f_TC_VBS_MSGF_BV_37_iut());*/ + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); - - - - - - - - + // Cleanup + f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + } // End of TC_VBS_MSGF_BV_37 } // End of group message_format @@ -1515,13 +1943,197 @@ module ItsVru_TestCases { } // End of TC_VBS_IFGN_BV_03 - } // End of group vruLowerLayerParameters + } // End of group vruLowerLayerParameters + + group vruSecurityEntity { + // Not implemented + } // End of group vruSecurityEntity + group vruTransmittingVAMs { + /** + * @desc Check that a VRU in VRU-ACTIVE-STANDALONE sends individual VAMs + *
+     * Pics Selection: PICS_VAM_GENERATION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              not containing vruClusterInformationContainer
+     *              and not containing vruClusterOperationContainer
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRANS/BV-01 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3 + */ + testcase TC_VBS_TRANS_BV_01() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_TRANS_BV_01(); + + } // End of TC_VBS_TRANS_BV_01 + + /** + * @desc Check that a VRU in VRU-ACTIVE-CLUSTER-LEADER sends cluster VAMs + *
+     * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing vruClusterInformationContainer
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 028-2 V2.0.2 (2024-11) TP/VBS/TRANS/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3 + */ + testcase TC_VBS_TRANS_BV_02() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_TRANS_BV_02_cluster_leader()); + v_iut.start(f_TC_VBS_TRANS_BV_02_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of TC_VBS_TRANS_BV_02 + + /** + * @desc Check that a VRU in VRU-PASSIVE sends individual VAMs containing VruClusterOperationContainer when leaving the VRU cluster + *
+     * Pics Selection: PICS_VAM_TRANSMISSION and PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing vruClusterOperationContainer
+     *                  and not containing vruClusterInformationContainer
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 038-2 V2.0.2 (2034-11) TP/VBS/TRANS/BV-03 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3 + */ + testcase TC_VBS_TRANS_BV_03() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + // Test control + if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_iut.start(f_TC_VBS_TRANS_BV_03_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of TC_VBS_TRANS_BV_03 + + /** + * @desc Check that a VRU in VRU-ACTIVE-STANDALONE sends individual VAMs containing VruClusterOperationContainer while joining a VRU cluster + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VRU determines to join cluster
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing vruClusterOperationContainer
+     *                  and not containing vruClusterInformationContainer
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 048-2 V2.0.2 (2044-11) TP/VBS/TRANS/BV-04 + * @reference ETSI TS 104 300-3 (V2.2.1), clause 6.3 + */ + testcase TC_VBS_TRANS_BV_04() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_iut.start(f_TC_VBS_TRANS_BV_04_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + } // End of TC_VBS_TRANS_BV_04 + } // End of group vruTransmittingVAMs group securityConstraints { diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn index b935deb..dcdc6b4 100644 --- a/ItsVru_TestControl.ttcn +++ b/ItsVru_TestControl.ttcn @@ -21,6 +21,11 @@ module ItsVru_TestControl { execute(TC_VBS_MSGF_BV_10()); execute(TC_VBS_MSGF_BV_12()); execute(TC_VBS_MSGF_BV_13()); + execute(TC_VBS_MSGF_BV_33()); + execute(TC_VBS_MSGF_BV_34()); + execute(TC_VBS_MSGF_BV_35()); + execute(TC_VBS_MSGF_BV_36()); + execute(TC_VBS_MSGF_BV_37()); if (PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST) { execute(TC_VBS_MSGF_BV_09()); @@ -41,6 +46,18 @@ module ItsVru_TestControl { execute(TC_VBS_MSGF_BV_18()); execute(TC_VBS_MSGF_BV_19()); execute(TC_VBS_MSGF_BV_20()); + execute(TC_VBS_MSGF_BV_21()); + execute(TC_VBS_MSGF_BV_22()); + execute(TC_VBS_MSGF_BV_23()); + execute(TC_VBS_MSGF_BV_24()); + execute(TC_VBS_MSGF_BV_25()); + execute(TC_VBS_MSGF_BV_26()); + execute(TC_VBS_MSGF_BV_27()); + execute(TC_VBS_MSGF_BV_28()); + execute(TC_VBS_MSGF_BV_29()); + execute(TC_VBS_MSGF_BV_30()); + execute(TC_VBS_MSGF_BV_31()); + execute(TC_VBS_MSGF_BV_32()); } execute(TC_VBS_IFGN_BV_01()); @@ -54,6 +71,14 @@ module ItsVru_TestControl { } + if (PICS_VAM_TRANSMISSION) { + execute(TC_VBS_TRANS_BV_01()); + if (PICS_CLUSTERING) { + execute(TC_VBS_TRANS_BV_02()); + execute(TC_VBS_TRANS_BV_03()); + } + execute(TC_VBS_TRANS_BV_04()); + } } } // End of module ItsVru_TestControl \ No newline at end of file diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 7801c4d..9891fd9 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -88,8 +88,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, mw_vru_low_frequency_container @@ -170,8 +171,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, -, mw_vru_cluster_information_container( @@ -287,8 +289,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, mw_vru_low_frequency_container @@ -363,8 +366,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, -, mw_vru_cluster_information_container, @@ -426,8 +430,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, mw_vru_low_frequency_container @@ -503,8 +508,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, -, mw_vru_cluster_information_container, @@ -639,6 +645,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( (v_lower_bound .. v_upper_bound) )))) { @@ -686,6 +693,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -700,6 +708,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -751,6 +760,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -802,6 +812,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -854,6 +865,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -906,6 +918,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -958,6 +971,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -1013,6 +1027,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -1066,6 +1081,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -1121,6 +1137,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -1172,6 +1189,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -1224,6 +1242,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -1277,6 +1296,7 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( -, mw_vam_parameters( @@ -1363,9 +1383,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, @@ -1417,9 +1438,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -1472,9 +1494,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -1527,9 +1550,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -1582,9 +1606,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -1638,8 +1663,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, mw_vru_low_frequency_container @@ -1710,8 +1736,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, -, mw_vru_cluster_information_container, @@ -1792,9 +1819,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -1882,9 +1910,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -1973,9 +2002,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -2136,9 +2166,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -2191,8 +2222,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, mw_vru_low_frequency_container @@ -2263,8 +2295,9 @@ module ItsVru_TpFunctions { [] vamPort.receive( mw_vamInd( mw_vamMsg( + f_getIutStationId(), mw_vru_awareness( - f_getIutStationId(), + -, mw_vam_parameters( -, -, -, mw_vru_cluster_information_container, @@ -2389,9 +2422,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, @@ -2465,9 +2499,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, -, @@ -2488,9 +2523,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, -, @@ -2541,9 +2577,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, -, @@ -2566,9 +2603,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, -, @@ -2658,9 +2696,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, -, @@ -2683,9 +2722,10 @@ module ItsVru_TpFunctions { tc_ac.start; alt { [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - mw_vru_awareness( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( -, mw_vam_parameters( -, -, -, -, -, @@ -2892,6 +2932,327 @@ module ItsVru_TpFunctions { } // End of group vruLowerLayerParameters + group vruSecurityEntity { + // Not implemented + } // End of group vruSecurityEntity + + group vruTransmittingVAMs { + + /** + * @desc TP Function for TC_VBS_TRANS_BV_01 + */ + function f_TC_VBS_TRANS_BV_01() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_TRANSMISSION or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + omit, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM not containing vruClusterInformationContainer and not containing vruClusterOperationContainer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_TRANS_BV_01 + + group f_TC_VBS_TRANS_BV_02 { + + function f_TC_VBS_TRANS_BV_02_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + var VamParameters v_vam_parameters; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + f_create_cluster_iut_as_leader( + v_fisrt_vam, + v_cluster_vam + ); + v_vam_parameters := v_cluster_vam.vam.vamParameters; + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(PX_TNOAC); + // Cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + + ))))))); + f_sleep(PX_TNOAC); + vamPort.send( + m_vruReq( + m_vamMsg( + f_getTsStationId(), + m_vru_awareness( + f_getCurrentTime() mod 65536, + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration + ), + -, + m_vru_cluster_information_container( + m_vru_cluster_information( + PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, + PX_VRU_CLUSTER_CREATE_ID, + m_shape_circular( + m_circular_shape( + PX_VRU_CLUSTER_CREATE_RADIUS + )), + PX_VRU_CLUSTER_CREATE_PROFILE + )), + m_vru_cluster_operation_container( + -, -, + m_cluster_breakup_info( + Vru_ClusterBreakupReason_clusteringPurposeCompleted + + ))))))); + log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + } + + function f_TC_VBS_TRANS_BV_02_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing vruClusterInformationContainer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_TRANS_BV_02_iut + + } // End of group f_TC_VBS_TRANS_BV_02 + + group f_TC_VBS_TRANS_BV_03 { + + function f_TC_VBS_TRANS_BV_03_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided)); + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + omit, + mw_vru_cluster_operation_container + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_TRANS_BV_03_iut + + } // End of group f_TC_VBS_TRANS_BV_03 + + group f_TC_VBS_TRANS_BV_04 { + + function f_TC_VBS_TRANS_BV_04_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided)); + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + omit, + mw_vru_cluster_operation_container + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_TRANS_BV_04_iut + + } // End of group f_TC_VBS_TRANS_BV_04 + + } // End of group vruTransmittingVAMs + + group securityConstraints { /** diff --git a/lib/LibItsVru_Pics.ttcn b/lib/LibItsVru_Pics.ttcn index cb1ad73..69337e6 100644 --- a/lib/LibItsVru_Pics.ttcn +++ b/lib/LibItsVru_Pics.ttcn @@ -9,6 +9,12 @@ module LibItsVru_Pics { */ modulepar boolean PICS_VAM_GENERATION := true; + /** + * @desc Support for VRU generation + * @see ETSI TS 104 019-1 Table A.1/1 + */ + modulepar boolean PICS_VAM_TRANSMISSION := true; + /** * @desc Is the IUT vehicle profile Pedestrain? * @see ETSI TS 104 019-1 Table A.3/1 diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn index 0895ed6..4ec6d00 100644 --- a/lib/LibItsVru_Templates.ttcn +++ b/lib/LibItsVru_Templates.ttcn @@ -123,6 +123,14 @@ module LibItsVru_Templates { setVruProfile := p_vru_profile } + /** + * @desc Set the VRU profile + * @param p_leave_cluster_with_cause The cause of the leave cluster request + */ + template (value) UtVamTrigger m_leaveClusterWithCause(in UInt8 p_leave_cluster_with_cause) := { + leaveClusterWithCause := p_leave_cluster_with_cause + } + } // End of group utPrimitives } // End of group Primitives @@ -161,8 +169,12 @@ module LibItsVru_Templates { * @desc Default Receive template for VAM PDU */ template (present) VAM mw_vamMsg( + template (present) StationId p_stationId, template (present) VruAwareness p_vam := ? ) modifies mw_vamMsg_any := { + header := { + stationId := p_stationId + }, vam := p_vam } diff --git a/lib/LibItsVru_TypesAndValues.ttcn b/lib/LibItsVru_TypesAndValues.ttcn index 068a124..565e106 100644 --- a/lib/LibItsVru_TypesAndValues.ttcn +++ b/lib/LibItsVru_TypesAndValues.ttcn @@ -21,11 +21,13 @@ module LibItsVru_TypesAndValues { } /** - * @desc + * @desc Upper Tester events * @member setVruProfile Set VRU profile + * @member leaveClusterWithCause Set VRU profile */ type union UtVamTrigger { - UInt8 setVruProfile + UInt8 setVruProfile, + UInt8 leaveClusterWithCause } with { variant "" } -- GitLab From fbcf1cfa3c9238869d31f25cdc28ff766d9e3f7b Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 28 Feb 2025 15:45:15 +0100 Subject: [PATCH 12/20] Validate VRU Test System --- ItsVru_TestCases.ttcn | 88 +++++++++++++++ ItsVru_TestControl.ttcn | 10 +- ItsVru_TpFunctions.ttcn | 163 +++++++++++++++++++++------- lib_system/LibItsVru_Functions.ttcn | 12 +- 4 files changed, 221 insertions(+), 52 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index a11949d..6dc82ec 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -2135,6 +2135,94 @@ module ItsVru_TestCases { } // End of group vruTransmittingVAMs + group vruTransitionTriggering { + + /** + * @desc Check that a VBS starts sending VAMs when the state changes from VRU-IDLE to VRU-ACTIVE-STANDALONE + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-IDLE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          state changes to VRU-ACTIVE-STANDALONE
+     *      }
+     *      then {
+     *          VAM is sent
+     *              not containing vruClusterOperationContainer
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-01 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 + */ + testcase TC_VBS_CLTR_BV_01() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_CLTR_BV_01(); + + } // End of TC_VBS_CLTR_BV_01 + + /** + * @desc Check that the cluster size is set to minClusterSize and the VRU profile field is set to the VRU profile + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions: 
+     *     with {
+     *         VBS in state VRU-IDLE and
+     *         VBS has VRU profile p 
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VBS determining to form a cluster
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing vruClusterInformationContainer
+     *                  containing clusterProfiles
+     *                      indicating value p
+     *                  and containing clusterCardinalitySize
+     *                      indicating value minClusterSize
+     *      }
+     *  } 
+     * 
+ * + * @see ETSI TS 104 028-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 + */ + testcase TC_VBS_CLTR_BV_02() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_initiate_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_initiate_cluster_leader, v_iut); + + // Start components + /* TODO v_vam_clustev_vam_initiate_cluster_leaderr_leader.start(f_TC_VBS_CLTR_BV_02_initiate_cluster_leader()); + v_iut.start(f_TC_VBS_CLTR_BV_02_iut());*/ + + // Synchronization + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_initiate_cluster_leader, v_iut); + + } // End of TC_VBS_CLTR_BV_02 + + } // End of group vruTransitionTriggering + group securityConstraints { /** diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn index dcdc6b4..fb68f44 100644 --- a/ItsVru_TestControl.ttcn +++ b/ItsVru_TestControl.ttcn @@ -9,7 +9,7 @@ module ItsVru_TestControl { // Test Execution control { - if(PICS_VAM_GENERATION) { + if(PICS_VAM_GENERATION and PICS_IS_IUT_SECURED) { execute(TC_VBS_MSGF_BV_01()); execute(TC_VBS_MSGF_BV_02()); execute(TC_VBS_MSGF_BV_03()); @@ -64,14 +64,12 @@ module ItsVru_TestControl { execute(TC_VBS_IFGN_BV_02()); execute(TC_VBS_IFGN_BV_03()); - if (PICS_IS_IUT_SECURED) { - execute(TC_VBS_SECC_BV_02()); - execute(TC_VBS_SECC_BV_04()); - } + execute(TC_VBS_SECC_BV_02()); + execute(TC_VBS_SECC_BV_04()); } - if (PICS_VAM_TRANSMISSION) { + if (PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED) { execute(TC_VBS_TRANS_BV_01()); if (PICS_CLUSTERING) { execute(TC_VBS_TRANS_BV_02()); diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 9891fd9..998d6af 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -577,8 +577,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -620,12 +620,12 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_02() runs on ItsVru { // Local variables - var integer v_lower_bound := (f_getCurrentTime() - 5000) mod 65536; // Time unit is millisecond - var integer v_upper_bound := (f_getCurrentTime() + 5000) mod 65536; // Time unit is millisecond + var integer v_lower_bound; // Time unit is millisecond + var integer v_upper_bound; // Time unit is millisecond // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -640,6 +640,8 @@ module ItsVru_TpFunctions { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body + v_lower_bound := (f_getCurrentTime() - 5000) mod 65536; + v_upper_bound := (f_getCurrentTime() + 5000) mod 65536; tc_ac.start; alt { [] vamPort.receive( @@ -653,6 +655,16 @@ module ItsVru_TpFunctions { log("*** " & testcasename() & ": PASS: VAM containing a generation time modulo 2^16 ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness + ))) { + tc_ac.stop; + log("*** " & testcasename() & ": ERROR: VAM containing an invalid generation time ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); @@ -672,8 +684,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -685,6 +697,8 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); + // Set VRU profile + f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body @@ -698,8 +712,7 @@ module ItsVru_TpFunctions { -, mw_vam_parameters( mw_basic_container( - (StationType_pedestrian_..StationType_motorcycle_) - //pedestrian, cyclist, moped, motorcycle, lightVruVehicle, animal + (StationType_pedestrian_ .. StationType_motorcycle_) )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***"); @@ -713,13 +726,25 @@ module ItsVru_TpFunctions { -, mw_vam_parameters( mw_basic_container( - (12..13) - //pedestrian, cyclist, moped, motorcycle, lightVruVehicle, animal + (StationType_lightVruVehicle .. StationType_animal) )))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***"); + log("*** " & testcasename() & ": PASS: VAM containing a valid StationType received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + mw_basic_container + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: VAM containing an invalid StationType received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); @@ -739,8 +764,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -791,8 +816,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -844,8 +869,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -897,8 +922,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -950,8 +975,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -1003,8 +1028,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not(PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST)) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST required for executing the TC ***"); + if (not(PICS_VAM_GENERATION and PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST)) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST required for executing the TC ***"); setverdict(inconc); stop; } @@ -1016,11 +1041,10 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - // Set VRU profile f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); - + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + // Test Body tc_ac.start; alt { @@ -1060,8 +1084,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -1168,8 +1192,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -1221,8 +1245,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -2777,8 +2801,8 @@ module ItsVru_TpFunctions { var boolean v_cond_1 := false, v_cond_2 := false; // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -2842,8 +2866,8 @@ module ItsVru_TpFunctions { const UInt8 c_GnHstSingleHop := 0; // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -2895,8 +2919,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -3252,6 +3276,65 @@ module ItsVru_TpFunctions { } // End of group vruTransmittingVAMs + group vruTransitionTriggering { + + /** + * @desc TP Function for TC_VBS_CLTR_BV_01 + */ + function f_TC_VBS_CLTR_BV_01() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_CLUSTERING or PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM not containing vruClusterOperationContainer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_CLTR_BV_01 + + group f_TC_VBS_CLTR_BV_02 { + + + } // End of group f_TC_VBS_CLTR_BV_02 + + } // End of group vruTransitionTriggering group securityConstraints { diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn index a952f51..8e6a67c 100644 --- a/lib_system/LibItsVru_Functions.ttcn +++ b/lib_system/LibItsVru_Functions.ttcn @@ -426,12 +426,12 @@ module LibItsVru_Functions { altstep a_default() runs on ItsVru { [vc_vruDefaultActive] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){ - log("*** a_default: INFO: CPM message received in default ***"); + log("*** a_default: INFO: VAM message received in default ***"); vc_vruReceived := true; repeat; } [vc_vruDefaultActive] vamPort.receive { - log("*** a_default: ERROR: event received on CPM port in default ***"); + log("*** a_default: ERROR: event received on VAM port in default ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] acPort.receive(AdapterControlResults: { acGnssTimeReached := ? }) { @@ -497,7 +497,7 @@ module LibItsVru_Functions { */ function f_prInitialState( in Scenario p_scenario := e_staticPosition, - in boolean p_awaitInitialCPM := true, + in boolean p_awaitInitialVAM := true, in template (value) UtVamInitialize p_vruInitialize := m_vruInitialize, in boolean p_awaitTimeInRunningScenario := true ) runs on ItsVru { @@ -518,15 +518,15 @@ module LibItsVru_Functions { f_acAwaitTimeInRunningScenario(f_getTimeForGpsFix()); } - if (p_awaitInitialCPM) { + if (p_awaitInitialVAM) { tc_ac.start; alt { [] vamPort.receive(mw_vamInd ( mw_vamMsg_any )){ tc_ac.stop; - log("*** " & testcasename() & ": INFO: Received initial CPM ***"); + log("*** " & testcasename() & ": INFO: Received initial VAM ***"); } [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Initial CPM not received ***"); + log("*** " & testcasename() & ": INCONC: Initial VAM not received ***"); f_selfOrClientSyncAndVerdictPreamble("error", e_timeout); } } // End of 'alt' statement -- GitLab From 48e9ac8ae606704bc142f14463fae469b58d9aa2 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 4 Mar 2025 11:29:23 +0100 Subject: [PATCH 13/20] Validate TC_VBS_MSGF_BV_01..TC_VBS_MSGF_BV_14 --- ItsVru_TpFunctions.ttcn | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 998d6af..dd1df9a 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -1138,7 +1138,7 @@ module ItsVru_TpFunctions { // Test control if (not PICS_VAM_GENERATION or not PICS_PROFILE_PEDESTRIAN or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN and not PICS_IS_IUT_SECURED required for executing the TC ***"); + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -1299,8 +1299,8 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_GENERATION or not PICS_PROFILE_BICYCLIST or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_PROFILE_BICYCLIST or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -1314,6 +1314,9 @@ module ItsVru_TpFunctions { f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + // Set VRU profile + f_utTriggerEvent(m_setVruProfile(Vru_profile_bicyclistAndLightVruVehicle)); + // Test Body tc_ac.start; alt { @@ -2970,7 +2973,7 @@ module ItsVru_TpFunctions { // Test control if (not PICS_VAM_TRANSMISSION or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -3286,7 +3289,7 @@ module ItsVru_TpFunctions { // Test control if (not PICS_CLUSTERING or PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } -- GitLab From 14062f56ed6c20e5980e6b35e9a6efc87ab517ca Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 12 Mar 2025 09:53:38 +0100 Subject: [PATCH 14/20] Validate TC_VBS_MSGF_BV_15 --- ItsVru_TestCases.ttcn | 34 ++- ItsVru_TpFunctions.ttcn | 351 ++++++++++++++++++++-------- lib/LibItsVru_Pixits.ttcn | 36 ++- lib_system/LibItsVru_Functions.ttcn | 8 +- 4 files changed, 327 insertions(+), 102 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index 6dc82ec..ac752f8 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -557,7 +557,7 @@ module ItsVru_TestCases { v_iut.start(f_TC_VBS_MSGF_BV_15_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup f_cfMtcDown01(v_vam_cluster_leader, v_iut); @@ -2221,8 +2221,40 @@ module ItsVru_TestCases { } // End of TC_VBS_CLTR_BV_02 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } // End of group vruTransitionTriggering + group vruTriggeringCondition { + } // End of group vruTriggeringCondition + group securityConstraints { /** diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index dd1df9a..59f5906 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -91,10 +91,8 @@ module ItsVru_TpFunctions { f_getIutStationId(), mw_vru_awareness( -, - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_vam { + mw_vam_parameters + )))) -> value v_vam { tc_ac.stop; p_first_iut_vam := v_vam.msgIn; v_vam_parameters := v_vam.msgIn.vam.vamParameters; @@ -141,28 +139,37 @@ module ItsVru_TpFunctions { v_vam_parameters.vruHighFrequencyContainer.rollAngle, v_vam_parameters.vruHighFrequencyContainer.deviceUsage ), - -, + -/*, m_vru_cluster_information_container( m_vru_cluster_information( PX_VRU_CLUSTER_CREATE_CARDINALITY, p_vru_cluster_create_id, m_shape_circular( m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), + PX_VRU_CLUSTER_CREATE_RADIUS, + m_cartesian_position3d( + v_vam_parameters.basicContainer.referencePosition.latitude, + v_vam_parameters.basicContainer.referencePosition.longitude + ))), PX_VRU_CLUSTER_CREATE_PROFILE - )))))); - f_generate_path_history( - 10, - p_first_iut_vam, - v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, - v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction - ); - for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) { - v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i; - v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; - vamPort.send(m_vruReq(v_updated_cluster_vam)); - f_sleep(1.0); + ))*/)))); + //log("------------------------- ", m_vru_motion_prediction_container); + //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); + //log("========================= ", p_updated_cluster_vam); + //f_generate_path_history( + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + // ); + //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + for (var integer i := 0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) { + v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i; + v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + vamPort.send(m_vruReq(v_updated_cluster_vam)); + f_sleep(0.1); + } // End of 'for' statement } // End of 'for' statement log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); // Wait for the IUT to create the cluster @@ -178,11 +185,21 @@ module ItsVru_TpFunctions { -, -, -, mw_vru_cluster_information_container( mw_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY + 1 - ))))))) -> value v_vam{ + PX_VRU_CLUSTER_CREATE_CARDINALITY + 1, + -, -, + PX_VRU_CLUSTER_CREATE_PROFILE + ))))))) -> value v_vam { tc_ac.stop; log("*** " & testcasename() & ": INFO: IUT created the cluster ***"); - } + } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId() + ))) { + log("*** " & testcasename() & ": INFO: Discard message ***"); + repeat; + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); return false; @@ -225,47 +242,61 @@ module ItsVru_TpFunctions { v_vam_parameters.vruHighFrequencyContainer.deviceUsage ), -, - v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer, + v_vam_parameters.vruClusterInformationContainer, m_vru_cluster_operation_container( m_cluster_join_info( - v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId + v_vam_parameters.vruClusterInformationContainer.vruClusterInformation.clusterId, + PX_VRU_REPETITION )))))); - f_generate_path_history( - 10, - p_first_iut_vam, - v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, - v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction - ); - for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) { - v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i; - v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; - vamPort.send(m_vruReq(v_updated_cluster_vam)); - f_sleep(1.0); + //log("------------------------- ", m_vru_motion_prediction_container); + //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); + //log("========================= ", v_updated_cluster_vam); + //f_generate_path_history( + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + // ); + //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) { + v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i; + v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + vamPort.send(m_vruReq(v_updated_cluster_vam)); + f_sleep(0.1); + } // End of 'for' statement } // End of 'for' statement - - // Cluster leader send a VA message to indicate the cluster presence - v_updated_cluster_vam.header.stationId := f_getTsStationId(); - v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; - f_generate_path_history( - 12, - p_first_iut_vam, - v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, - v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction - ); - v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof( - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY + 1, - p_vru_cluster_create_id, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - ))); - v_updated_cluster_vam.vam.vamParameters.vruClusterOperationContainer := omit; - vamPort.send(m_vruReq(v_updated_cluster_vam)); - log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***"); + log("*** " & testcasename() & ": INFO: Simulated joined the IUT cluster, stop sending VAMs ***"); + + // // Cluster leader send a VA message to indicate the cluster presence + // //log("------------------------- ", m_vru_motion_prediction_container); + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); + // //log("========================= ", p_updated_cluster_vam); + // f_generate_path_history( + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + // ); + // //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); + // v_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof( + // m_vru_cluster_information_container( + // m_vru_cluster_information( + // PX_VRU_CLUSTER_CREATE_CARDINALITY + 1, + // p_vru_cluster_create_id, + // m_shape_circular( + // m_circular_shape( + // PX_VRU_CLUSTER_CREATE_RADIUS + // )), + // PX_VRU_CLUSTER_CREATE_PROFILE + // ))); + // v_updated_cluster_vam.vam.vamParameters.vruClusterOperationContainer := omit; + // v_updated_cluster_vam.header.stationId := f_getTsStationId(); + // v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + // vamPort.send(m_vruReq(v_updated_cluster_vam)); + // log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***"); + + p_updated_cluster_vam := v_vam.msgIn; return true; } // End of function f_create_cluster_iut_as_leader @@ -292,10 +323,8 @@ module ItsVru_TpFunctions { f_getIutStationId(), mw_vru_awareness( -, - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_vam { + mw_vam_parameters + )))) -> value v_vam { tc_ac.stop; p_first_iut_vam := v_vam.msgIn; v_vam_parameters := v_vam.msgIn.vam.vamParameters; @@ -312,7 +341,7 @@ module ItsVru_TpFunctions { m_vamMsg( f_getTsStationId(), m_vru_awareness( - f_getCurrentTime() mod 65536, + 0, // Updated before to be sent m_vam_parameters( m_basic_container( StationType_bus_, @@ -352,13 +381,20 @@ module ItsVru_TpFunctions { )), PX_VRU_CLUSTER_CREATE_PROFILE )))))); - f_generate_path_history( - 10, - p_first_iut_vam, - p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, - p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction - ); - vamPort.send(m_vruReq(p_updated_cluster_vam)); + //log("------------------------- ", m_vru_motion_prediction_container); + //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); + //log("========================= ", v_updated_cluster_vam); + //f_generate_path_history( + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + // ); + //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + vamPort.send(m_vruReq(p_updated_cluster_vam)); + } // End of 'for' statement log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); // Wait for the IUT to join the cluster tc_ac.start; @@ -372,22 +408,32 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, mw_vru_cluster_information_container, - m_vru_cluster_operation_container( - mw_cluster_join_info( - p_vru_cluster_create_id - ))))))) { + mw_vru_cluster_operation_container( + mw_cluster_join_info( + p_vru_cluster_create_id + ))))))) -> value v_vam { tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + + if (v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime > 0) { + log("*** " & testcasename() & ": INFO: IUT will join the cluster in ", v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime, "seconds ***"); + tc_noac.start(int2float(valueof(v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime))); + repeat; + } else { + tc_ac.start; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } } + [] tc_noac.timeout { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); return false; } } // End of 'alt' statement - f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence - p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; f_generate_path_history( 12, p_first_iut_vam, @@ -405,7 +451,20 @@ module ItsVru_TpFunctions { )), PX_VRU_CLUSTER_CREATE_PROFILE ))); - vamPort.send(m_vruReq(p_updated_cluster_vam)); + //log("------------------------- ", m_vru_motion_prediction_container); + //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); + //log("========================= ", v_updated_cluster_vam); + //f_generate_path_history( + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + // ); + //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + vamPort.send(m_vruReq(p_updated_cluster_vam)); + } // End of 'for' statement log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***"); return true; @@ -434,8 +493,7 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, - mw_vru_low_frequency_container + -, - ))))) -> value v_vam { tc_ac.stop; p_first_iut_vam := v_vam.msgIn; @@ -493,13 +551,16 @@ module ItsVru_TpFunctions { )), PX_VRU_CLUSTER_CREATE_PROFILE )))))); + //log("------------------------- ", m_vru_motion_prediction_container); p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); + //log("========================= ", p_updated_cluster_vam); f_generate_path_history( 10, p_first_iut_vam, p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction ); + //log("+++++++++++++++++++++++++ ", p_updated_cluster_vam); vamPort.send(m_vruReq(p_updated_cluster_vam)); log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); // Wait for the IUT to join the cluster @@ -554,7 +615,69 @@ module ItsVru_TpFunctions { return true; } // End of function f_initiate_cluster_iut_as_member + /** + * @desc Terminate a cluster initiated by the IUT + */ function f_terminate_cluster(in VAM p_vam) runs on ItsVru { + var VAM v_updated_cluster_vam; + var VamParameters v_vam_parameters := p_vam.vam.vamParameters; + + // Send x VAM with leaving VRU cluster indication + v_updated_cluster_vam := valueof( + m_vamMsg( + 0, // Updated before to be sent + m_vru_awareness( + 0, // Updated before to be sent + m_vam_parameters( + m_basic_container( + StationType_bus_, + m_reference_position_with_confidence( + v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, + v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, + v_vam_parameters.basicContainer.referencePosition.altitude + )), + m_vru_high_frequency_container( + v_vam_parameters.vruHighFrequencyContainer.heading, + m_speed( + v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, + v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence + ), + v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.curvature, + v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, + v_vam_parameters.vruHighFrequencyContainer.yawRate, + v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, + v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, + v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, + v_vam_parameters.vruHighFrequencyContainer.environment, + v_vam_parameters.vruHighFrequencyContainer.movementControl, + v_vam_parameters.vruHighFrequencyContainer.orientation, + v_vam_parameters.vruHighFrequencyContainer.rollAngle, + v_vam_parameters.vruHighFrequencyContainer.deviceUsage + ), + -, -, + m_vru_cluster_operation_container( + -, + m_cluster_leave_info( + v_vam_parameters.vruClusterInformationContainer.vruClusterInformation.clusterId, + Vru_clusterLeaveReason_cancelledJoin + )))))); + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + for (var integer i :=0; i < PX_VRU_CLUSTER_CREATE_CARDINALITY; i := i + 1) { + v_updated_cluster_vam.header.stationId := f_getTsStationId() + 1 + i; + v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + vamPort.send(m_vruReq(v_updated_cluster_vam)); + f_sleep(0.1); + } // End of 'for' statement + } // End of 'for' statement + log("*** " & testcasename() & ": INFO: VRU cluster initiated by the IUT terminated ***"); + } // End of function f_terminate_cluster + + /** + * @desc Terminate a simulated cluster + */ + function f_terminate_simulated_cluster(in VAM p_vam) runs on ItsVru { p_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; p_vam.vam.vamParameters.vruClusterOperationContainer := valueof( m_vru_cluster_operation_container( @@ -563,8 +686,8 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_BREAKUP_REASON ))); vamPort.send(m_vruReq(p_vam)); - log("*** " & testcasename() & ": INFO: VAMcluster deleted***"); - } // End of function f_terminate_cluster + log("*** " & testcasename() & ": INFO: VRU simulated cluster terminatted ***"); + } // End of function f_terminate_simulated_cluster } // End of group LibHelpers_Functions @@ -1367,18 +1490,19 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble - // Set the UIT in VRU-PASSIVE mode - if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode + if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } else { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); } // Test Body - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence - vamPort.send(m_vruReq(v_cluster_vam)); - log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + // f_sleep(PX_TNOAC); + // // Cluster leader send a VA message to indicate the cluster presence + // vamPort.send(m_vruReq(v_cluster_vam)); + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble @@ -1402,6 +1526,8 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); + f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); // Wait for the IUT to join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); @@ -1986,7 +2112,7 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble - // Set the UIT in VRU-PASSIVE mode + // Set the IUT in VRU-PASSIVE mode if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } else { @@ -2681,7 +2807,7 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble - // Set the UIT in VRU-PASSIVE mode + // Set the IUT in VRU-PASSIVE mode if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam, PX_VRU_CLUSTER_CREATE_ID + 1) == false) { // Use a different cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } else { @@ -3337,8 +3463,51 @@ module ItsVru_TpFunctions { } // End of group f_TC_VBS_CLTR_BV_02 + group f_TC_VBS_CLTR_BV_03 { + + + } // End of group f_TC_VBS_CLTR_BV_03 + + group f_TC_VBS_CLTR_BV_04 { + + + } // End of group f_TC_VBS_CLTR_BV_04 + + group f_TC_VBS_CLTR_BV_05 { + + + } // End of group f_TC_VBS_CLTR_BV_05 + + group f_TC_VBS_CLTR_BV_06 { + + + } // End of group f_TC_VBS_CLTR_BV_06 + + group f_TC_VBS_CLTR_BV_07 { + + + } // End of group f_TC_VBS_CLTR_BV_07 + + group f_TC_VBS_CLTR_BV_08 { + + + } // End of group f_TC_VBS_CLTR_BV_08 + + group f_TC_VBS_CLTR_BV_09 { + + + } // End of group f_TC_VBS_CLTR_BV_09 + + group f_TC_VBS_CLTR_BV_10 { + + + } // End of group f_TC_VBS_CLTR_BV_10 + } // End of group vruTransitionTriggering + group vruTriggeringCondition { + } // End of group vruTriggeringCondition + group securityConstraints { /** diff --git a/lib/LibItsVru_Pixits.ttcn b/lib/LibItsVru_Pixits.ttcn index 2d4aded..7497e20 100644 --- a/lib/LibItsVru_Pixits.ttcn +++ b/lib/LibItsVru_Pixits.ttcn @@ -11,16 +11,40 @@ module LibItsVru_Pixits { // LibItsCommon import from LibItsCommon_ASN1_NamedNumbers all; - modulepar UInt8 PX_IUT_VRU_PROFILE_TYPE := 2; - - modulepar CardinalNumber1B PX_VRU_CLUSTER_CREATE_CARDINALITY := 3; - + /** + * @desc To trigger to the IUT which profile to apply + * @see PX_VRU_CLUSTER_CREATE_PROFILE + */ + modulepar UInt8 PX_IUT_VRU_PROFILE_TYPE := Vru_profile_bicyclistAndLightVruVehicle; + + /** + * @desc To trigger to the IUT which cluster profile to apply + */ + modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE := '0001'B; // bicyclist + + /** + * @desc To indicates how many time a message shall be sent + */ + modulepar integer PX_VRU_REPETITION := 1; + + /** + * @desc To indicates the cardinality of a cluster initiated by the IUT (>= 3, 3 + the IUT as leader) + */ + modulepar CardinalNumber1B PX_VRU_CLUSTER_CREATE_CARDINALITY := 4; + + /** + * @desc To indicates the cluster ID when initiated by the TS + */ modulepar Identifier1B PX_VRU_CLUSTER_CREATE_ID := 78; // Random number + /** + * @desc To indicates the size of the clusterBoundingBoxShape + */ modulepar StandardLength12b PX_VRU_CLUSTER_CREATE_RADIUS := 30; // 3 meters - modulepar VruClusterProfiles PX_VRU_CLUSTER_CREATE_PROFILE := '0000'B; // At least one pedestrian - + /** + * @desc To indicates the reason of breaking the cluster + */ modulepar ClusterBreakupReason PX_VRU_CLUSTER_BREAKUP_REASON := Vru_ClusterBreakupReason_clusteringPurposeCompleted; modulepar UInt32 PX_DELTA_LATITUDE_IN_BOX := 10; diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn index 8e6a67c..9c9f1f4 100644 --- a/lib_system/LibItsVru_Functions.ttcn +++ b/lib_system/LibItsVru_Functions.ttcn @@ -246,8 +246,8 @@ module LibItsVru_Functions { out ItsVru p_vam_cluster_leader, out ItsVru p_iut ) runs on ItsBaseMtc { - p_vam_cluster_leader := ItsVru.create("VRU-CLUSTER_LEADER") alive; - p_iut := ItsVru.create("VRU-IUT") alive; + p_vam_cluster_leader := ItsVru.create("VRU_CLUSTER_LEADER") alive; + p_iut := ItsVru.create("VRU_IUT") alive; connect(self:syncPort, mtc:syncPort); connect(p_vam_cluster_leader:syncPort, self:syncPort); @@ -353,7 +353,7 @@ module LibItsVru_Functions { */ function f_cfUp_cluster_leader() runs on ItsVru system ItsVruSystem { - map(self:utPort, system:utPort); + //map(self:utPort, system:utPort); map(self:acPort, system:acPort); map(self:vamPort, system:vamPort); f_connect4SelfOrClientSync(); @@ -375,7 +375,7 @@ module LibItsVru_Functions { unmap(self:vamPort, system:vamPort); f_acStopScenario(); - unmap(self:utPort, system:utPort); + //unmap(self:utPort, system:utPort); unmap(self:acPort, system:acPort); f_disconnect4SelfOrClientSync(); -- GitLab From 4c97a8bdbef807f69e4814cb31e0b42cbb289bd8 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 14 Mar 2025 14:25:36 +0100 Subject: [PATCH 15/20] Validate TC_VBS_MSGF_BV_16 --- ItsVru_TestCases.ttcn | 592 ++++++++++++++++------- ItsVru_TestControl.ttcn | 12 + ItsVru_TpFunctions.ttcn | 1009 ++++++++++++++++++++------------------- 3 files changed, 955 insertions(+), 658 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index ac752f8..8da4ee9 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -9,13 +9,13 @@ module ItsVru_TestCases { // LibItsCommon import from LibItsCommon_TestSystem all; - + // LibItsVru import from LibItsVru_TestSystem all; import from LibItsVru_Functions all; import from LibItsVru_Pics all; - - // Ats Its + + // AtsVRU import from ItsVru_TpFunctions all; group message_format { @@ -24,7 +24,7 @@ module ItsVru_TestCases { * @desc Check that protocolVersion is set to 3 and messageID is set to 16 *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -42,9 +42,9 @@ module ItsVru_TestCases {
      *              and containing messageID
      *                  indicating value 16
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-01 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.2 */ @@ -58,7 +58,7 @@ module ItsVru_TestCases { * @desc Check that the generation time in the VAM is the time of reference position since ITS epoch modulo 2^16 *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -73,9 +73,9 @@ module ItsVru_TestCases {
      *              containing generation time
      *                  indicating reference position time in milliseconds since ITS epoch mod 2^16
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-02 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.2 */ @@ -89,7 +89,7 @@ module ItsVru_TestCases { * @desc Check that stationType only takes supported values *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -111,9 +111,9 @@ module ItsVru_TestCases {
      *                          indicating lightVruVehicle or
      *                          indicating animal
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-03 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.1 */ @@ -127,7 +127,7 @@ module ItsVru_TestCases { * @desc Check that the reference point is the ground position of the center of the front side of the bounding box of the VRU *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -144,9 +144,9 @@ module ItsVru_TestCases {
      *                      containing ReferencePosition
      *                          indicating ground position of the center of the front side of the bounding box
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-04 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.1 */ @@ -160,7 +160,7 @@ module ItsVru_TestCases { * @desc Check that the curvature includes the curvatureValue which is the inverse of the VRU curve radius and the turning direction of the curve *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -179,9 +179,9 @@ module ItsVru_TestCases {
      *                          containing curvatureValue
      *                              indicating DIRECTION * 1/(RADIUS*10000)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-05 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 */ @@ -195,7 +195,7 @@ module ItsVru_TestCases { * @desc Check that the yawRate includes the yawRateValue *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -214,9 +214,9 @@ module ItsVru_TestCases {
      *                          containing yawRateValue
      *                              indicating YAW_RATE
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-06 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 */ @@ -230,7 +230,7 @@ module ItsVru_TestCases { * @desc Check that the lateralAcceleration indicates the lateral acceleration perpendicular to the heading direction *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -249,9 +249,9 @@ module ItsVru_TestCases {
      *                          containing yawRateValue
      *                              indicating LAT_ACC
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-07 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 */ @@ -265,7 +265,7 @@ module ItsVru_TestCases { * @desc Check that the vruLanePosition describes a lane on the road, a lane off the road or an island between two lanes *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -283,9 +283,9 @@ module ItsVru_TestCases {
      *                      containing simpleLanePosition
      *                          indicating lane LANE
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-08 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 */ @@ -299,7 +299,7 @@ module ItsVru_TestCases { * @desc Check that the orientation defines the angle between the longitudinal axis and WGS84 north *
      * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -319,9 +319,9 @@ module ItsVru_TestCases {
      *                              containing headingValue
      *                                  indicating value HEADING
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-09 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 */ @@ -335,7 +335,7 @@ module ItsVru_TestCases { * @desc Check that the rollAngle includes the angle between the ground plane and the vehicle's y-axis as well as the angle accuracy and that no values between 500 and 3100 are used *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -356,9 +356,9 @@ module ItsVru_TestCases {
      *                          and containing headingConfidence
      *                              indicating value CONFIDENCE < 500 and CONFIDENCE > 3100
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-10 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 */ @@ -372,7 +372,7 @@ module ItsVru_TestCases { * @desc Check that the deviceUsage uses values between 0 and 8 *
      * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -391,9 +391,9 @@ module ItsVru_TestCases {
      *                      containing deviceUsage
      *                          indicating value D
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-11 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.3 */ @@ -407,7 +407,7 @@ module ItsVru_TestCases { * @desc Check that the profileAndSubprofile contains the profile and sub-profile of the VRU if the VRU LF container is present *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -428,9 +428,9 @@ module ItsVru_TestCases {
      *                          containing sub-profile
      *                              indicating value included in SUBPROFILE
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-12 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4 */ @@ -444,7 +444,7 @@ module ItsVru_TestCases { * @desc Check that the sizeClass contains size information of the VRU *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -463,9 +463,9 @@ module ItsVru_TestCases {
      *                      containing sizeClass
      *                          indicating value SC
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-13 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4 */ @@ -479,7 +479,7 @@ module ItsVru_TestCases { * @desc Check that exteriorLights is present for VRU profile 2 *
      * Pics Selection: PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -497,9 +497,9 @@ module ItsVru_TestCases {
      *                  containing vruLowFrequencyContainer
      *                      containing exteriorLights
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-14 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.4 */ @@ -513,7 +513,7 @@ module ItsVru_TestCases { * @desc Check that clusterProfiles is not set to zeros if VRU has profile 1, 2 or 4 *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING or PICS_PROFILE_PEDESTRIAN or PICS_PROFILE_BICYCLIST or PICS_PROFILE_ANIMAL
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -531,9 +531,9 @@ module ItsVru_TestCases {
      *                      containing clusterProfiles
      *                          not indicating value 0000
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-15 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -568,7 +568,7 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates clusterLeaderLost when the cluster leader is lost *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-PASSIVE
      *         and VRU has last received a cluster VRU from cluster leader at time T1
@@ -586,36 +586,36 @@ module ItsVru_TestCases {
      *                          containing clusterLeaveReason
      *                              indicating clusterLeaderLost (1)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-16 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ testcase TC_VBS_MSGF_BV_16() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control - if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_16_cluster_member()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_16_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of testcase TC_VBS_MSGF_BV_16 @@ -623,14 +623,14 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates clusterDisbandedByLeader when the cluster leader breaks up the cluster *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-PASSIVE
      *     }
      * Expected behaviour:
      *  ensure that {
      *      when {
-     *          the IUT receives VAM 
+     *          the IUT receives VAM
      *              containing VamAwarness
      *                  containing vruClusterOperationContainer
      *                      containing clusterLeaveInfo
@@ -645,36 +645,36 @@ module ItsVru_TestCases {
      *                          containing clusterLeaveReason
      *                              indicating clusterDisbandedByLeader (2)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-17 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ testcase TC_VBS_MSGF_BV_17() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control - if (not(PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { - log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not PICS_VAM_GENERATION or not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_16_cluster_member()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_17_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of testcase TC_VBS_MSGF_BV_17 @@ -682,7 +682,7 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates outOfClusterBoundingBox when the VRU moves out of the cluster bounding box *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-PASSIVE and
      *         VRU has received a cluster VAM from cluster leader
@@ -693,7 +693,7 @@ module ItsVru_TestCases {
      * Expected behaviour:
      *  ensure that {
      *      when {
-     *          the IUT is alerted about new reference position value P and 
+     *          the IUT is alerted about new reference position value P and
      *          P is not inside S
      *      }
      *      then {
@@ -704,9 +704,9 @@ module ItsVru_TestCases {
      *                          containing clusterLeaveReason
      *                              indicating outOfClusterBoundingBox (3)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-18 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -741,7 +741,7 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates outOfClusterSpeedRange when the VRU is out of the cluster speed range *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-PASSIVE and
      *         VRU has received a cluster VAM from cluster leader
@@ -764,9 +764,9 @@ module ItsVru_TestCases {
      *                          containing clusterLeaveReason
      *                              indicating outOfClusterSpeedRange (4)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-19 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -801,7 +801,7 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates joiningAnotherCluster when the VRU is joining another cluster *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-PASSIVE
      *     }
@@ -824,9 +824,9 @@ module ItsVru_TestCases {
      *                          containing clusterId
      *                              indicating CId
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-20 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -863,7 +863,7 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates CancelledJoin when the joining is cancelled *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         and VBS has started joining the cluster
@@ -884,9 +884,9 @@ module ItsVru_TestCases {
      *                          containing clusterLeaveReason
      *                              indicating CancelledJoin (6)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-21 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -921,7 +921,7 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates FailedJoin when the joining is cancelled *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         and VBS has started joining the cluster
@@ -942,9 +942,9 @@ module ItsVru_TestCases {
      *                          containing clusterLeaveReason
      *                              indicating FailedJoin (7)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-22 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -979,7 +979,7 @@ module ItsVru_TestCases { * @desc Check that clusterLeaveReason indicates SafetyCondition when another cluster VRU comes too close *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-PASSIVE
      *     }
@@ -998,9 +998,9 @@ module ItsVru_TestCases {
      *                          containing clusterLeaveReason
      *                              indicating SafetyCondition (8)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-23 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1037,7 +1037,7 @@ module ItsVru_TestCases { * @desc Check that clusterBreakupReason indicates clusteringPurposeCompleted when the clustering purpose is completed *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
      *     }
@@ -1055,9 +1055,9 @@ module ItsVru_TestCases {
      *                      containing clusterBreakupInfo
      *                          indicating clusteringPurposeCompleted (1)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-24 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1092,9 +1092,9 @@ module ItsVru_TestCases { * @desc Check that clusterBreakupReason indicates clusteringPurposeCompleted when the clustering purpose is completed *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
-     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER and 
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER and
      *         VRU has sent a cluster VAM
      *             containing vruClusterInformationContainer
      *                 containing clusterBoundingBoxShape
@@ -1115,9 +1115,9 @@ module ItsVru_TestCases {
      *                      containing clusterBreakupInfo
      *                          indicating leaderMovedOutOfClusterBoundingBox (2)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-25 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1152,7 +1152,7 @@ module ItsVru_TestCases { * @desc Check that clusterBreakupReason indicates joiningAnotherCluster when the cluster leader is joining another cluster *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
      *     }
@@ -1176,9 +1176,9 @@ module ItsVru_TestCases {
      *                          containing clusterId
      *                              indicating value CId
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-26 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1214,7 +1214,7 @@ module ItsVru_TestCases { * @desc Check that clusterBreakupReason indicates enteringLowriskareaBasedonMAPs when the cluster leader is entering a low-risk area *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
      *     }
@@ -1232,9 +1232,9 @@ module ItsVru_TestCases {
      *                      containing clusterBreakupInfo
      *                          indicating value enteringLowriskareaBasedonMAPs (4)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-27 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1270,7 +1270,7 @@ module ItsVru_TestCases { * @desc Check that clusterBreakupReason indicates receptionOfCPMcontainingCluster when a CPM containing a cluster is received *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
      *     }
@@ -1288,9 +1288,9 @@ module ItsVru_TestCases {
      *                      containing clusterBreakupInfo
      *                          indicating value receptionOfCPMcontainingCluster (5)
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-28 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1326,7 +1326,7 @@ module ItsVru_TestCases { * @desc Check that clusterIdChangeTimeInfo indicates the time the cluster leader intents to change the cluster ID *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
      *     }
@@ -1343,9 +1343,9 @@ module ItsVru_TestCases {
      *                      containing clusterIdChangeTimeInfo
      *                          indicating planned ID change time
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-29 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1381,7 +1381,7 @@ module ItsVru_TestCases { * @desc Check that the ClusterLeaveReason is systematically set to 0 if the reason for breaking up or leaving the cluster cannot be matched with the other reasons (1-8) *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
      *     }
@@ -1401,9 +1401,9 @@ module ItsVru_TestCases {
      *                      and containing clusterLeaveReason
      *                          indicating value 0
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-30 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.5 */ @@ -1439,7 +1439,7 @@ module ItsVru_TestCases { * @desc Check that the VruMotionPredictionContainer includes the pathHistory of type PathHistory consisting of up to 40 past points *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1458,9 +1458,9 @@ module ItsVru_TestCases {
      *                          containing n <= 40 PathPoints
      *                              containing pathPosition
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-31 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 */ @@ -1493,7 +1493,7 @@ module ItsVru_TestCases { * @desc Check that the VruMotionPredictionContainer includes the path prediction of type PathPredicted consisting of up to 15 future points, confidence values and time instances *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1513,9 +1513,9 @@ module ItsVru_TestCases {
      *                              containing horizontalPositionConfidence
      *                              and containing pathDeltaTime
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-32 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 */ @@ -1548,7 +1548,7 @@ module ItsVru_TestCases { * @desc Check that the vruMotionPredictionContainer includes the safe distance indication that includes timeToCollision *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1569,9 +1569,9 @@ module ItsVru_TestCases {
      *                              containing timeToCollision
      *                                  indicating value TTC
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-33 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 */ @@ -1606,7 +1606,7 @@ module ItsVru_TestCases { * @desc Check that the vruMotionPredictionContainer includes the accelerationChangeIndication of type AccelerationChangeIndication containing accelOrDecel and actionDeltaTime *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1628,9 +1628,9 @@ module ItsVru_TestCases {
      *                          indicating value DELTA_TIME
 
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-34 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 */ @@ -1665,7 +1665,7 @@ module ItsVru_TestCases { * @desc Check that the vruMotionPredictionContainer includes the headingChangeIndication of type HeadingChangeIndication containing the dircetion and actionDeltaTime *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1686,9 +1686,9 @@ module ItsVru_TestCases {
      *                          and containing actionDeltaTime
      *                              indicating value DELTA_TIME
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-35 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 */ @@ -1723,7 +1723,7 @@ module ItsVru_TestCases { * @desc Check that the vruMotionPredictionContainer includes the stabilityChangeIndication of type StabilityChangeIndication containing the lossProbability and actionDeltaTime *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1744,9 +1744,9 @@ module ItsVru_TestCases {
      *                          and containing actionDeltaTime
      *                              indicating value DELTA_TIME
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-36 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 */ @@ -1781,7 +1781,7 @@ module ItsVru_TestCases { * @desc Check that profile 3 VRUs only transmit a VRU special vehicle container in the CAM instead of full VAM *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1793,16 +1793,16 @@ module ItsVru_TestCases {
      *          IUT is triggered to send awareness message
      *      }
      *      then {
-     *          CAM is sent 
+     *          CAM is sent
      *              containing specialVehicleContainer
      *                  containing vruSpecialVehicleContainer
      *                      containing vruSubProfileMotorcyclist
      *                      and containing sizeClass
      *          and no VAM is generated
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/MSGF/BV-37 * @reference ETSI TS 103 300-3 (V2.2.1), clause 7.3.6 */ @@ -1841,7 +1841,7 @@ module ItsVru_TestCases { * @desc Check that the BTP header type B and the destination port is passed if the value is not provided by the ITS-S configuration *
      * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1862,9 +1862,9 @@ module ItsVru_TestCases {
      *                      indicating value 2018
 
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-01 * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2 */ @@ -1878,7 +1878,7 @@ module ItsVru_TestCases { * @desc Check that the GN packet transport type is GeoNetworking SHB and passed if the value is not provided by the ITS-S configuration *
      * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1897,9 +1897,9 @@ module ItsVru_TestCases {
      *                  containing Header Type
      *                      indicating SHB
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-02 * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2 */ @@ -1913,7 +1913,7 @@ module ItsVru_TestCases { * @desc Check that the GN Traffic class is the same value as for the CAM *
      * Pics Selection: PICS_VAM_GENERATION AND NOT PICS_IS_IUT_SECURED
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -1931,9 +1931,9 @@ module ItsVru_TestCases {
      *                      containing Traffic Class
      *                          indicating value TC = 2
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/IFGN/BV-03 * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.3.3.2 */ @@ -1941,7 +1941,7 @@ module ItsVru_TestCases { f_TC_VBS_IFGN_BV_03(); - } // End of TC_VBS_IFGN_BV_03 + } // End of TC_VBS_IFGN_BV_03 } // End of group vruLowerLayerParameters @@ -1955,7 +1955,7 @@ module ItsVru_TestCases { * @desc Check that a VRU in VRU-ACTIVE-STANDALONE sends individual VAMs *
      * Pics Selection: PICS_VAM_GENERATION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *     }
@@ -1969,9 +1969,9 @@ module ItsVru_TestCases {
      *              not containing vruClusterInformationContainer
      *              and not containing vruClusterOperationContainer
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRANS/BV-01 * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3 */ @@ -1985,7 +1985,7 @@ module ItsVru_TestCases { * @desc Check that a VRU in VRU-ACTIVE-CLUSTER-LEADER sends cluster VAMs *
      * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *     }
@@ -1998,10 +1998,10 @@ module ItsVru_TestCases {
      *          VAM is sent
      *              containing vruClusterInformationContainer
      *      }
-     *  } 
+     *  }
      * 
- * - * @see ETSI TS 104 028-2 V2.0.2 (2024-11) TP/VBS/TRANS/BV-02 + * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRANS/BV-02 * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3 */ testcase TC_VBS_TRANS_BV_02() runs on ItsBaseMtc system ItsVruSystem { @@ -2035,7 +2035,7 @@ module ItsVru_TestCases { * @desc Check that a VRU in VRU-PASSIVE sends individual VAMs containing VruClusterOperationContainer when leaving the VRU cluster *
      * Pics Selection: PICS_VAM_TRANSMISSION and PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *     }
@@ -2049,9 +2049,9 @@ module ItsVru_TestCases {
      *              containing vruClusterOperationContainer
      *                  and not containing vruClusterInformationContainer
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 038-2 V2.0.2 (2034-11) TP/VBS/TRANS/BV-03 * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.3 */ @@ -2086,7 +2086,7 @@ module ItsVru_TestCases { * @desc Check that a VRU in VRU-ACTIVE-STANDALONE sends individual VAMs containing VruClusterOperationContainer while joining a VRU cluster *
      * Pics Selection: PICS_VAM_TRANSMISSION
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *     }
@@ -2100,9 +2100,9 @@ module ItsVru_TestCases {
      *              containing vruClusterOperationContainer
      *                  and not containing vruClusterInformationContainer
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 048-2 V2.0.2 (2044-11) TP/VBS/TRANS/BV-04 * @reference ETSI TS 104 300-3 (V2.2.1), clause 6.3 */ @@ -2141,7 +2141,7 @@ module ItsVru_TestCases { * @desc Check that a VBS starts sending VAMs when the state changes from VRU-IDLE to VRU-ACTIVE-STANDALONE *
      * Pics Selection: PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-IDLE
      *     }
@@ -2154,15 +2154,15 @@ module ItsVru_TestCases {
      *          VAM is sent
      *              not containing vruClusterOperationContainer
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-01 * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 */ testcase TC_VBS_CLTR_BV_01() runs on ItsVru system ItsVruSystem { - f_TC_VBS_CLTR_BV_01(); + // TODO f_TC_VBS_CLTR_BV_01(); } // End of TC_VBS_CLTR_BV_01 @@ -2170,10 +2170,10 @@ module ItsVru_TestCases { * @desc Check that the cluster size is set to minClusterSize and the VRU profile field is set to the VRU profile *
      * Pics Selection: PICS_CLUSTERING
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-IDLE and
-     *         VBS has VRU profile p 
+     *         VBS has VRU profile p
      *     }
      * Expected behaviour:
      *  ensure that {
@@ -2188,10 +2188,10 @@ module ItsVru_TestCases {
      *                  and containing clusterCardinalitySize
      *                      indicating value minClusterSize
      *      }
-     *  } 
+     *  }
      * 
- * - * @see ETSI TS 104 028-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-02 + * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-02 * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 */ testcase TC_VBS_CLTR_BV_02() runs on ItsBaseMtc system ItsVruSystem { @@ -2210,8 +2210,8 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_initiate_cluster_leader, v_iut); // Start components - /* TODO v_vam_clustev_vam_initiate_cluster_leaderr_leader.start(f_TC_VBS_CLTR_BV_02_initiate_cluster_leader()); - v_iut.start(f_TC_VBS_CLTR_BV_02_iut());*/ + /* TODO v_vam_clustev_vam_initiate_cluster_leaderr_leader.start(// TODO f_TC_VBS_CLTR_BV_02_initiate_cluster_leader()); + v_iut.start(// TODO f_TC_VBS_CLTR_BV_02_iut());*/ // Synchronization f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); @@ -2221,6 +2221,252 @@ module ItsVru_TestCases { } // End of TC_VBS_CLTR_BV_02 + /** + * @desc Check that a VBS in VRU-ACTIVE-STANDALONE stops the transmission of VAMs when changing to VRU-IDLE + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          state changes to VRU-IDLE
+     *      }
+     *      then {
+     *          VBS stops sending VAMs
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-03 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 + */ + testcase TC_VBS_CLTR_BV_03() runs on ItsBaseMtc system ItsVruSystem { + + // TODO f_TC_VBS_CLTR_BV_03(); + + } // End of TC_VBS_CLTR_BV_03 + + /** + * @desc Check that a cluster breaking VRU stops sending cluster VAMs + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and breakup indication has been sent
+
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VBS breaking up cluster
+     *      }
+     *      then {
+     *          VBS stops sending cluster VAMs
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-04 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 + */ + testcase TC_VBS_CLTR_BV_04() runs on ItsBaseMtc system ItsVruSystem { + + // TODO f_TC_VBS_CLTR_BV_04(); + + } // End of TC_VBS_CLTR_BV_04 + + /** + * @desc Check that a VRU sends an indication of joining a cluster for timeClusterJoinNotification including the identified cluster and time at which it stops sending individual VAMs + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VBS has received a VAM from a cluster leader
+     *              containing basicContainer
+     *                  containing referencePosition
+     *                      indicating Position
+     *                      and distance(Position, EgoPosition) < maxClusterDistance
+     *              and containing vruHighFreuquencyContainer
+     *                  containing speed
+     *                      contaiing speedValue
+     *                      indicating value
+     *                      and abs(value – EgoSpeed) < maxClusterVelocityDifference
+     *              and containing vruClusterInformationContainer
+     *                  containing clusterId
+     *                      indicating Cid
+     *                  and containing clusterCardinalitySize
+     *                      indicating value < maxClusterSize
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              for timeClusterJoinNotification
+     *                  not containing vruClusterInformationContainer
+     *                  and containing clusterOperationContainer
+     *                      containing clusterJoinInfo
+     *                          containing clusterId
+     *                              indicating CId
+     *                          and containing joinTime
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-05 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 + */ + testcase TC_VBS_CLTR_BV_05() runs on ItsBaseMtc system ItsVruSystem { + + // TODO f_TC_VBS_CLTR_BV_05(); + + } // End of TC_VBS_CLTR_BV_05 + + /** + * @desc Check that a VBS sends individual VAMs after a cancelled-join oder failed-join including the same station ID as before and the cluster leave notification for timeClusterLeaveNotification + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and cancelled-join has occured or failed-join has occured
+     *         and stationID is value sID
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VBS generates VAM
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              not containing vruClusterInformationContainer
+     *              and containing ITS PDU header
+     *                  containing stationID
+     *                      indicating sID
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-06 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 + */ + testcase TC_VBS_CLTR_BV_06() runs on ItsBaseMtc system ItsVruSystem { + + // TODO f_TC_VBS_CLTR_BV_06(); + + } // End of TC_VBS_CLTR_BV_06 + + /** + * @desc Check that a VRU leaving a cluster indicates the identified cluster and the reason for timeClusterLeaveNotification + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VRU leaving cluster CL1
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              for timeClusterLeaveNotification
+     *                  containing vruClusterOperationContainer
+     *                      contianing vruClusterInformationContainer
+     *                          containing clusterId
+     *                              indicating CL1
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-07 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 + */ + testcase TC_VBS_CLTR_BV_07() runs on ItsBaseMtc system ItsVruSystem { + + // TODO f_TC_VBS_CLTR_BV_07(); + + } // End of TC_VBS_CLTR_BV_07 + + /** + * @desc Check that a cluster leader indicates a cluster ID change for timeClusterIdChangeNotification before the change + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and is triggered to change cluster ID
+     *         and VBS has sent VAM
+     *             containing vruClusterInformationContainer
+     *                 containing clusterID
+     *                     indicating cID1
+     *         and containing vruClusterOperationContainer
+     *             containing clusterIdChangeTimeInfo
+     *                 indicating value x
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          IUT is sending
+     *      }
+     *      then {
+     *          VBS sends multiple VAMs
+     *              during timeClusterIdChangeNotification
+     *                  containing vruClusterInformationContainer
+     *                  and containing vruClusterOperationContainer
+     *                      containing clusterIdChangeTimeInfo
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-09 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.3 + */ + testcase TC_VBS_CLTR_BV_09() runs on ItsBaseMtc system ItsVruSystem { + + // TODO f_TC_VBS_CLTR_BV_09(); + + } // End of TC_VBS_CLTR_BV_09 + + /** + * @desc Check that a cluster leader sends a cluster VAM with the new ID as soon as possible + *
+     * Pics Selection: PICS_CLUSTERING
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and change ID notification has been sent
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          IUT is changing cluster ID
+     *      }
+     *      then {
+     *          VBS sends VAMs
+     *              containing vruClusterInformationContainer
+     *                  containing clusterId
+     *                      indicating new cluster ID
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-10 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.3 + */ + testcase TC_VBS_CLTR_BV_10() runs on ItsBaseMtc system ItsVruSystem { + + // TODO f_TC_VBS_CLTR_BV_10(); + + } // End of TC_VBS_CLTR_BV_10 + @@ -2261,7 +2507,7 @@ module ItsVru_TestCases { * @desc Check that the ITS-AID indicates the application for which permissions are being granted *
      * Pics Selection: PICS_VAM_GENERATION AND PICS_IS_IUT_SECURED
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -2281,9 +2527,9 @@ module ItsVru_TestCases {
      *                                  containing ToBeSigned
      *                                      containing AppPermissions
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/SECC/BV-02 * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.5.1 */ @@ -2291,13 +2537,13 @@ module ItsVru_TestCases { f_TC_VBS_SECC_BV_02(); - } // End of TC_VBS_SECC_BV_02 + } // End of TC_VBS_SECC_BV_02 /** * @desc Check that the SSP is a BitmapSsp *
      * Pics Selection: PICS_VAM_GENERATION AND PICS_IS_IUT_SECURED
-     * Initial conditions: 
+     * Initial conditions:
      *     with {
      *         VBS in state VRU-ACTIVE-STANDALONE
      *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
@@ -2319,9 +2565,9 @@ module ItsVru_TestCases {
      *                                          containing at least one item
      *                                              containing Bitmap SSP
      *      }
-     *  } 
+     *  }
      * 
- * + * * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/SECC/BV-02 * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.5.2 */ diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn index fb68f44..a9cfe90 100644 --- a/ItsVru_TestControl.ttcn +++ b/ItsVru_TestControl.ttcn @@ -69,6 +69,18 @@ module ItsVru_TestControl { } + if (PICS_CLUSTERING) { + execute(TC_VBS_CLTR_BV_01()); + execute(TC_VBS_CLTR_BV_02()); + execute(TC_VBS_CLTR_BV_03()); + execute(TC_VBS_CLTR_BV_04()); + execute(TC_VBS_CLTR_BV_05()); + execute(TC_VBS_CLTR_BV_06()); + execute(TC_VBS_CLTR_BV_07()); + //execute(TC_VBS_CLTR_BV_08()); + execute(TC_VBS_CLTR_BV_09()); + execute(TC_VBS_CLTR_BV_10()); + } if (PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED) { execute(TC_VBS_TRANS_BV_01()); if (PICS_CLUSTERING) { diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 59f5906..112a4c7 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -18,9 +18,6 @@ module ItsVru_TpFunctions { import from LibItsCommon_ASN1_NamedNumbers all; import from LibItsCommon_CddTemplates all; - // LibItsGeoNetworking - //import from LibItsGeoNetworking_TypesAndValues all; - // LibItsVru import from LibItsVru_TestSystem all; import from LibItsVru_Functions all; @@ -29,6 +26,7 @@ module ItsVru_TpFunctions { import from LibItsVru_Pics all; import from LibItsVru_Pixits all; + // LibItsSecurity import from LibItsSecurity_Functions all; group LibHelpers_Functions { @@ -92,13 +90,13 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters - )))) -> value v_vam { + )))) -> value v_vam { tc_ac.stop; p_first_iut_vam := v_vam.msgIn; v_vam_parameters := v_vam.msgIn.vam.vamParameters; log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); return false; @@ -113,7 +111,7 @@ module ItsVru_TpFunctions { 0, // Updated before to be sent m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, @@ -121,7 +119,7 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence @@ -157,9 +155,9 @@ module ItsVru_TpFunctions { //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); //log("========================= ", p_updated_cluster_vam); //f_generate_path_history( - // 10, - // p_first_iut_vam, - // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction // ); //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); @@ -188,7 +186,7 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_CARDINALITY + 1, -, -, PX_VRU_CLUSTER_CREATE_PROFILE - ))))))) -> value v_vam { + ))))))) -> value v_vam { tc_ac.stop; log("*** " & testcasename() & ": INFO: IUT created the cluster ***"); } @@ -199,7 +197,7 @@ module ItsVru_TpFunctions { ))) { log("*** " & testcasename() & ": INFO: Discard message ***"); repeat; - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); return false; @@ -215,7 +213,7 @@ module ItsVru_TpFunctions { 0, // Updated before to be sent m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, @@ -223,7 +221,7 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence @@ -252,9 +250,9 @@ module ItsVru_TpFunctions { //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); //log("========================= ", v_updated_cluster_vam); //f_generate_path_history( - // 10, - // p_first_iut_vam, - // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction // ); //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); @@ -267,15 +265,15 @@ module ItsVru_TpFunctions { } // End of 'for' statement } // End of 'for' statement log("*** " & testcasename() & ": INFO: Simulated joined the IUT cluster, stop sending VAMs ***"); - + // // Cluster leader send a VA message to indicate the cluster presence // //log("------------------------- ", m_vru_motion_prediction_container); // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); // //log("========================= ", p_updated_cluster_vam); // f_generate_path_history( - // 10, - // p_first_iut_vam, - // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction // ); // //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); @@ -295,12 +293,12 @@ module ItsVru_TpFunctions { // v_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; // vamPort.send(m_vruReq(v_updated_cluster_vam)); // log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***"); - + p_updated_cluster_vam := v_vam.msgIn; return true; } // End of function f_create_cluster_iut_as_leader - + /** * @desc Set the IUT in VRU-PASSIVE mode */ @@ -324,13 +322,13 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters - )))) -> value v_vam { + )))) -> value v_vam { tc_ac.stop; p_first_iut_vam := v_vam.msgIn; v_vam_parameters := v_vam.msgIn.vam.vamParameters; log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); return false; @@ -344,7 +342,7 @@ module ItsVru_TpFunctions { 0, // Updated before to be sent m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, @@ -352,7 +350,7 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence @@ -385,9 +383,9 @@ module ItsVru_TpFunctions { //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); //log("========================= ", v_updated_cluster_vam); //f_generate_path_history( - // 10, - // p_first_iut_vam, - // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // 10, + // p_first_iut_vam, + // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction // ); //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); @@ -406,40 +404,49 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, -, - mw_vru_cluster_information_container, + -, -, -, -, mw_vru_cluster_operation_container( mw_cluster_join_info( p_vru_cluster_create_id - ))))))) -> value v_vam { + ))))))) -> value v_vam { tc_ac.stop; if (v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime > 0) { log("*** " & testcasename() & ": INFO: IUT will join the cluster in ", v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime, "seconds ***"); - tc_noac.start(int2float(valueof(v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime))); + if (not tc_noac.running) { + tc_noac.start(int2float(valueof(v_vam.msgIn.vam.vamParameters.vruClusterOperationContainer.clusterJoinInfo.joinTime))); + } repeat; } else { - tc_ac.start; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + log("*** " & testcasename() & ": INFO: IUT joined the cluster immediately ***"); } - } + } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness + ))) { + log("*** " & testcasename() & ": INFO: Unexpected VAM received ***"); + repeat; + } [] tc_noac.timeout { tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + log("*** " & testcasename() & ": INFO: IUT joined the cluster after timeout ***"); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); return false; } } // End of 'alt' statement - + // Cluster leader send a VA message to indicate the cluster presence - f_generate_path_history( - 12, - p_first_iut_vam, - p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, - p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction - ); + // f_generate_path_history( + // 12, + // p_first_iut_vam, + // p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + // p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction + // ); p_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof( m_vru_cluster_information_container( m_vru_cluster_information( @@ -451,25 +458,16 @@ module ItsVru_TpFunctions { )), PX_VRU_CLUSTER_CREATE_PROFILE ))); - //log("------------------------- ", m_vru_motion_prediction_container); - //v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); - //log("========================= ", v_updated_cluster_vam); - //f_generate_path_history( - // 10, - // p_first_iut_vam, - // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, - // v_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction - // ); //log("+++++++++++++++++++++++++ ", v_updated_cluster_vam); for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; vamPort.send(m_vruReq(p_updated_cluster_vam)); } // End of 'for' statement - log("*** " & testcasename() & ": INFO: VAM cluster created and existing ***"); + log("*** " & testcasename() & ": INFO: VAM cluster alive ***"); return true; } // End of function f_create_cluster_iut_as_member - + /** * @desc Initiate a cluster with error */ @@ -494,13 +492,13 @@ module ItsVru_TpFunctions { -, mw_vam_parameters( -, - - ))))) -> value v_vam { + ))))) -> value v_vam { tc_ac.stop; p_first_iut_vam := v_vam.msgIn; v_vam_parameters := v_vam.msgIn.vam.vamParameters; log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); return false; @@ -514,7 +512,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, @@ -522,7 +520,7 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence @@ -555,9 +553,9 @@ module ItsVru_TpFunctions { p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer := valueof(m_vru_motion_prediction_container); //log("========================= ", p_updated_cluster_vam); f_generate_path_history( - 10, - p_first_iut_vam, - p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + 10, + p_first_iut_vam, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction ); //log("+++++++++++++++++++++++++ ", p_updated_cluster_vam); @@ -578,23 +576,23 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( mw_cluster_join_info( PX_VRU_CLUSTER_CREATE_ID - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); return false; } } // End of 'alt' statement - + f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence p_updated_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; f_generate_path_history( - 12, - p_first_iut_vam, - p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, + 12, + p_first_iut_vam, + p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathHistory, p_updated_cluster_vam.vam.vamParameters.vruMotionPredictionContainer.pathPrediction ); p_updated_cluster_vam.vam.vamParameters.vruClusterInformationContainer := valueof( @@ -614,7 +612,7 @@ module ItsVru_TpFunctions { return true; } // End of function f_initiate_cluster_iut_as_member - + /** * @desc Terminate a cluster initiated by the IUT */ @@ -630,7 +628,7 @@ module ItsVru_TpFunctions { 0, // Updated before to be sent m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, @@ -638,7 +636,7 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence @@ -673,7 +671,7 @@ module ItsVru_TpFunctions { } // End of 'for' statement log("*** " & testcasename() & ": INFO: VRU cluster initiated by the IUT terminated ***"); } // End of function f_terminate_cluster - + /** * @desc Terminate a simulated cluster */ @@ -681,14 +679,14 @@ module ItsVru_TpFunctions { p_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; p_vam.vam.vamParameters.vruClusterOperationContainer := valueof( m_vru_cluster_operation_container( - -, -, + -, -, m_cluster_breakup_info( PX_VRU_CLUSTER_BREAKUP_REASON ))); vamPort.send(m_vruReq(p_vam)); log("*** " & testcasename() & ": INFO: VRU simulated cluster terminatted ***"); } // End of function f_terminate_simulated_cluster - + } // End of group LibHelpers_Functions group message_format { @@ -698,40 +696,40 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_01() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { [] vamPort.receive( mw_vamInd( mw_vamMsg_any - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM messageID is set to 16 ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -745,23 +743,23 @@ module ItsVru_TpFunctions { // Local variables var integer v_lower_bound; // Time unit is millisecond var integer v_upper_bound; // Time unit is millisecond - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body v_lower_bound := (f_getCurrentTime() - 5000) mod 65536; v_upper_bound := (f_getCurrentTime() + 5000) mod 65536; @@ -773,27 +771,27 @@ module ItsVru_TpFunctions { f_getIutStationId(), mw_vru_awareness( (v_lower_bound .. v_upper_bound) - )))) { + )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing a generation time modulo 2^16 ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] vamPort.receive( mw_vamInd( mw_vamMsg( f_getIutStationId(), mw_vru_awareness - ))) { + ))) { tc_ac.stop; log("*** " & testcasename() & ": ERROR: VAM containing an invalid generation time ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -805,25 +803,25 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_03() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); // Set VRU profile f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -836,11 +834,11 @@ module ItsVru_TpFunctions { mw_vam_parameters( mw_basic_container( (StationType_pedestrian_ .. StationType_motorcycle_) - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing valid StationType received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] vamPort.receive( mw_vamInd( mw_vamMsg( @@ -850,11 +848,11 @@ module ItsVru_TpFunctions { mw_vam_parameters( mw_basic_container( (StationType_lightVruVehicle .. StationType_animal) - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing a valid StationType received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] vamPort.receive( mw_vamInd( mw_vamMsg( @@ -863,17 +861,17 @@ module ItsVru_TpFunctions { -, mw_vam_parameters( mw_basic_container - ))))) { + ))))) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: VAM containing an invalid StationType received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -885,23 +883,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_04() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -915,17 +913,17 @@ module ItsVru_TpFunctions { mw_basic_container( -, LibItsVru_Templates.mw_reference_position - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing reference position ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -937,23 +935,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_05() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -968,17 +966,17 @@ module ItsVru_TpFunctions { mw_vru_high_frequency_container( -, -, -, mw_curvature - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing curvature value ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -990,23 +988,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_06() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1021,17 +1019,17 @@ module ItsVru_TpFunctions { mw_vru_high_frequency_container( -, -, -, -, -, -, mw_lateral_acceleration - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing yaw-rate value ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1043,23 +1041,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_07() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1074,17 +1072,17 @@ module ItsVru_TpFunctions { mw_vru_high_frequency_container( -, -, -, -, -, mw_yaw_rate - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing yaw-rate value ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1096,23 +1094,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_08() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1127,17 +1125,17 @@ module ItsVru_TpFunctions { mw_vru_high_frequency_container( -, -, -, -, -, -, -, -, mw_generalized_lane_position - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1149,17 +1147,17 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_09() runs on ItsVru { // Local variables - + // Test control if (not(PICS_VAM_GENERATION and PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST)) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED and PICS_PROFILE_BICYCLIST or PICS_PROFILE_MOTORCYCLIST required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble @@ -1167,7 +1165,7 @@ module ItsVru_TpFunctions { // Set VRU profile f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1180,20 +1178,20 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, mw_vru_high_frequency_container( - -, -, -, -, -, -, -, -, -, -, -, -, + -, -, -, -, -, -, -, -, -, -, -, -, mw_cartesian_angle( complement((500 .. 3100)) - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing RollAngle angle value (500 .. 3100 range excluded) ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1205,23 +1203,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_10() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1236,17 +1234,17 @@ module ItsVru_TpFunctions { mw_vru_high_frequency_container( -, -, -, -, -, -, -, -, -, -, -, -, -, (0 .. 8) - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1258,23 +1256,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_11() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_PROFILE_PEDESTRIAN or PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_PEDESTRIAN and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Set VRU profile f_utTriggerEvent(m_setVruProfile(Vru_profile_pedestrian)); @@ -1291,17 +1289,17 @@ module ItsVru_TpFunctions { -, mw_vru_high_frequency_container( mw_wgs84_angle - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing VRU lane position value ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1313,23 +1311,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_12() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1344,17 +1342,17 @@ module ItsVru_TpFunctions { -, mw_vru_low_frequency_container( mw_vru_profile_and_subprofile_pedestrian - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing profile and sub-profile of the VRU ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1366,23 +1364,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_13() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1398,17 +1396,17 @@ module ItsVru_TpFunctions { mw_vru_low_frequency_container( -, ? - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing class zize ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1420,23 +1418,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_MSGF_BV_14() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_PROFILE_BICYCLIST or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_PROFILE_BICYCLIST and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Set VRU profile f_utTriggerEvent(m_setVruProfile(Vru_profile_bicyclistAndLightVruVehicle)); @@ -1455,17 +1453,17 @@ module ItsVru_TpFunctions { mw_vru_low_frequency_container( -, -, ? - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing class zize ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -1486,7 +1484,7 @@ module ItsVru_TpFunctions { // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -1503,8 +1501,8 @@ module ItsVru_TpFunctions { // // Cluster leader send a VA message to indicate the cluster presence // vamPort.send(m_vruReq(v_cluster_vam)); log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + // Postamble // Delete the cluster f_terminate_cluster(v_cluster_vam); @@ -1516,21 +1514,21 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_15_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble f_prInitialState(); f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); - // Wait for the IUT to join the cluster + // Wait for the IUT to create the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body vamPort.clear; tc_ac.start; @@ -1547,17 +1545,17 @@ module ItsVru_TpFunctions { mw_vru_cluster_information( -, -, -, complement('0000'B) - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing clusterProfiles not set to zeros ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown_iut(); @@ -1571,22 +1569,55 @@ module ItsVru_TpFunctions { */ group f_TC_VBS_MSGF_BV_16 { + function f_TC_VBS_MSGF_BV_16_cluster_member() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + // Do not sent VAM cluster anymore to trigger clusterLeaveReason with clusterLeaderLost + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and no more VAM cluster sent ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_16_cluster_member + function f_TC_VBS_MSGF_BV_16_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble f_prInitialState(); - // Wait for the cluster creation - // Join the cluster + f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the IUT to join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1601,18 +1632,19 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, mw_cluster_leave_info( + -, Vru_clusterLeaveReason_clusterLeaderLost - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterLeaderLost ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -1629,12 +1661,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_17_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -1642,7 +1674,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1657,18 +1689,19 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, mw_cluster_leave_info( + -, Vru_clusterLeaveReason_clusterDisbandedByLeader - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterDisbandedByLeader ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -1685,12 +1718,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_18_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -1698,7 +1731,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1713,18 +1746,19 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, mw_cluster_leave_info( + -, Vru_clusterLeaveReason_outOfClusterBoundingBox - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterBoundingBox ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -1741,12 +1775,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_19_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -1754,7 +1788,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1769,18 +1803,19 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, mw_cluster_leave_info( + -, Vru_clusterLeaveReason_outOfClusterSpeedRange - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterSpeedRange ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -1799,12 +1834,12 @@ module ItsVru_TpFunctions { // Local variables var VamInd v_fisrt_vam; var VamParameters v_vam_parameters; - + // Test control // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -1822,10 +1857,10 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { + ))))) -> value v_fisrt_vam { tc_ac.stop; log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); @@ -1841,7 +1876,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -1849,7 +1884,7 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence @@ -1898,17 +1933,17 @@ module ItsVru_TpFunctions { m_vru_cluster_operation_container( mw_cluster_join_info( PX_VRU_CLUSTER_CREATE_ID - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } } // End of 'alt' statement f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence @@ -1920,7 +1955,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -1928,8 +1963,8 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, + v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.speed, v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, @@ -1942,11 +1977,11 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_RADIUS )), PX_VRU_CLUSTER_CREATE_PROFILE - + ))))))); log("*** " & testcasename() & ": PASS: VAM better cluster created and existing ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + // Postamble f_poDefault(); f_cfDown_cluster_leader(); @@ -1954,12 +1989,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_20_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -1967,7 +2002,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1984,18 +2019,19 @@ module ItsVru_TpFunctions { ? // FIXME FSCOM Set the correct cluster id ), mw_cluster_leave_info( + -, Vru_clusterLeaveReason_joiningAnotherCluster - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_joiningAnotherCluster ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -2014,12 +2050,12 @@ module ItsVru_TpFunctions { // Local variables var VAM v_fisrt_vam; var VAM v_cluster_vam; - + // Test control // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -2027,17 +2063,18 @@ module ItsVru_TpFunctions { m_vru_cluster_operation_container( -, mw_cluster_leave_info( + -, Vru_clusterLeaveReason_cancelledJoin )), v_fisrt_vam, v_cluster_vam ); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + // Postamble f_poDefault(); f_cfDown_cluster_leader(); @@ -2045,12 +2082,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_21_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -2058,7 +2095,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -2073,18 +2110,19 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, mw_cluster_leave_info( + -, Vru_clusterLeaveReason_outOfClusterSpeedRange - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterSpeedRange ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -2108,7 +2146,7 @@ module ItsVru_TpFunctions { // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -2124,8 +2162,8 @@ module ItsVru_TpFunctions { // Cluster leader send a VA message to indicate the cluster presence vamPort.send(m_vruReq(v_cluster_vam)); log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + // Postamble // Delete the cluster f_terminate_cluster(v_cluster_vam); @@ -2137,12 +2175,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_23_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -2150,7 +2188,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -2165,18 +2203,19 @@ module ItsVru_TpFunctions { mw_vru_cluster_operation_container( -, mw_cluster_leave_info( + -, Vru_clusterLeaveReason_safetyCondition - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_safetyCondition ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -2196,12 +2235,12 @@ module ItsVru_TpFunctions { var VAM v_fisrt_vam; var VAM v_cluster_vam; var VamParameters v_vam_parameters; - + // Test control // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -2211,7 +2250,7 @@ module ItsVru_TpFunctions { ); v_vam_parameters := v_cluster_vam.vam.vamParameters; f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed @@ -2223,7 +2262,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -2231,11 +2270,11 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), + ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, @@ -2248,7 +2287,7 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_RADIUS )), PX_VRU_CLUSTER_CREATE_PROFILE - + ))))))); f_sleep(PX_TNOAC); vamPort.send( @@ -2259,7 +2298,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -2267,11 +2306,11 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), + ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, @@ -2289,11 +2328,11 @@ module ItsVru_TpFunctions { -, -, m_cluster_breakup_info( Vru_ClusterBreakupReason_clusteringPurposeCompleted - + ))))))); log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + // Postamble f_poDefault(); f_cfDown_cluster_leader(); @@ -2301,12 +2340,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_24_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -2314,7 +2353,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -2331,17 +2370,17 @@ module ItsVru_TpFunctions { m_cluster_breakup_info( Vru_ClusterBreakupReason_clusteringPurposeCompleted - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_ClusterBreakupReason_clusteringPurposeCompleted ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -2360,12 +2399,12 @@ module ItsVru_TpFunctions { // Local variables var VamInd v_fisrt_vam; var VamParameters v_vam_parameters; - + // Test control // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -2381,10 +2420,10 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { + ))))) -> value v_fisrt_vam { tc_ac.stop; log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); @@ -2400,7 +2439,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_IN_BOX, v_vam_parameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_IN_BOX, @@ -2408,7 +2447,7 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_IN_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence @@ -2457,17 +2496,17 @@ module ItsVru_TpFunctions { m_vru_cluster_operation_container( mw_cluster_join_info( PX_VRU_CLUSTER_CREATE_ID - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } } // End of 'alt' statement f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence and cluster completed @@ -2479,7 +2518,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -2487,11 +2526,11 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), + ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, @@ -2504,7 +2543,7 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_RADIUS )), PX_VRU_CLUSTER_CREATE_PROFILE - + ))))))); f_sleep(PX_TNOAC); vamPort.send( @@ -2515,7 +2554,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -2523,11 +2562,11 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), + ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, @@ -2545,11 +2584,11 @@ module ItsVru_TpFunctions { -, -, m_cluster_breakup_info( PX_VRU_CLUSTER_BREAKUP_REASON - + ))))))); log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + // Postamble f_poDefault(); f_cfDown_cluster_leader(); @@ -2557,12 +2596,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_25_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -2570,7 +2609,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -2587,17 +2626,17 @@ module ItsVru_TpFunctions { m_cluster_breakup_info( Vru_ClusterBreakupReason_leaderMovedOutOfClusterBoundingBox - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing Vru_ClusterBreakupReason_leaderMovedOutOfClusterBoundingBox ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -2639,12 +2678,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_31_iut() runs on ItsVru { // Local variables var VamInd v_fisrt_vam, v_vam; - + // Test control - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble @@ -2660,18 +2699,18 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, -, -, mw_vru_motion_prediction_container(?) - ))))) -> value v_fisrt_vam{ + ))))) -> value v_fisrt_vam{ tc_ac.stop; log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } } // End of 'alt' statement f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -2684,7 +2723,7 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, -, -, mw_vru_motion_prediction_container(?) - ))))) -> value v_vam { + ))))) -> value v_vam { tc_ac.stop; if (lengthof(v_fisrt_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory) < lengthof(v_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory)) { @@ -2694,13 +2733,13 @@ module ItsVru_TpFunctions { log("*** " & testcasename() & ": FAIL: Invalid number of PathPoint in PathHistory ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -2717,12 +2756,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_32_iut() runs on ItsVru { // Local variables var VamInd v_fisrt_vam, v_vam; - + // Test control - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble @@ -2740,18 +2779,18 @@ module ItsVru_TpFunctions { mw_vru_motion_prediction_container( -, ? - )))))) -> value v_fisrt_vam{ + )))))) -> value v_fisrt_vam{ tc_ac.stop; log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } } // End of 'alt' statement f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -2764,7 +2803,7 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, -, -, mw_vru_motion_prediction_container(?) - ))))) -> value v_vam { + ))))) -> value v_vam { tc_ac.stop; if (lengthof(v_fisrt_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory) < lengthof(v_vam.msgIn.vam.vamParameters.vruMotionPredictionContainer.pathHistory)) { @@ -2774,13 +2813,13 @@ module ItsVru_TpFunctions { log("*** " & testcasename() & ": FAIL: Invalid number of PathPoint in PathHistory ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -2803,7 +2842,7 @@ module ItsVru_TpFunctions { // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -2819,8 +2858,8 @@ module ItsVru_TpFunctions { // Cluster leader send a VA message to indicate the cluster presence vamPort.send(m_vruReq(v_cluster_vam)); log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + // Postamble // Delete the cluster f_terminate_cluster(v_cluster_vam); @@ -2836,12 +2875,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_MSGF_BV_33_iut() runs on ItsVru { // Local variables var VamInd v_fisrt_vam, v_vam; - + // Test control - + // Test component configuration f_cfUp(); - + // Test adapter configuration // Preamble @@ -2859,18 +2898,18 @@ module ItsVru_TpFunctions { mw_vru_motion_prediction_container( -, ? - )))))) -> value v_fisrt_vam{ + )))))) -> value v_fisrt_vam{ tc_ac.stop; log("*** " & testcasename() & ": INFO: First VAM containing VruMotionPredictionContainer value received ***"); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } } // End of 'alt' statement f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -2889,18 +2928,18 @@ module ItsVru_TpFunctions { mw_safe_distance_indication(-, -, ?), * } - )))))) -> value v_vam { + )))))) -> value v_vam { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing VruMotionPredictionContainer value received with increased number of PathHistory ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -2918,169 +2957,169 @@ module ItsVru_TpFunctions { } // End of group message_format group vruLowerLayerParameters { - + /** * @desc TP Function for TC_VBS_IFGN_BV_01 */ function f_TC_VBS_IFGN_BV_01() runs on ItsVru { - + // Local variables const UInt8 c_gnNhBtpB := 2; const UInt16 c_btp_port := 2018; var boolean v_cond_1 := false, v_cond_2 := false; - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { - [v_cond_1 == false] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, c_gnNhBtpB)) { + [v_cond_1 == false] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, c_gnNhBtpB)) { log("*** " & testcasename() & ": INFO: Expected VRU message encapsultated in BTP-B packet received ***"); v_cond_1 := true; - repeat; + repeat; } - [v_cond_2 == false] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any, c_btp_port)) { + [v_cond_2 == false] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any, c_btp_port)) { log("*** " & testcasename() & ": INFO: Expected VRU message encapsultated in BTP-B packet received ***"); v_cond_2 := true; - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [v_cond_1 == true and v_cond_2 == true] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any)) { + [v_cond_1 == true and v_cond_2 == true] vamPort.receive(mw_vamIndWithBtpParameters(mw_vamMsg_any)) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected VRU message encapsultated in BTP-B packet with the correct BTP port received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, omit)) { + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, omit)) { tc_ac.stop; log("*** " & testcasename() & ": INCONC: no GN NH information in CpmInd ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) { + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in BTP-B packet ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } - + // Postamble f_poDefault(); f_cfDown(); - + } // End of function f_TC_VBS_IFGN_BV_01 /** * @desc TP Function for TC_VBS_IFGN_BV_02 */ function f_TC_VBS_IFGN_BV_02() runs on ItsVru { - + // Local variables const UInt8 c_gnHtTsb := 5; const UInt8 c_GnHstSingleHop := 0; - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; - } - + } + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { - [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, c_gnHtTsb, c_GnHstSingleHop)) { + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, c_gnHtTsb, c_GnHstSingleHop)) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected VRU message encapsulated in SHB packet received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, omit, omit)) { + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, omit, omit)) { tc_ac.stop; log("*** " & testcasename() & ": INCONC: no GN HT/HST information in CpmInd ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) { + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + [] vamPort.receive(mw_vamInd(mw_vamMsg_any)) { tc_ac.stop; log("*** " & testcasename() & ": FAIL: Expected VRU message received, but not encapsulated in SHB packet ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } - + // Postamble f_poDefault(); f_cfDown(); - + } // End of function f_TC_VBS_IFGN_BV_02 - + /** * @desc TP Function for TC_VBS_IFGN_BV_03 */ function f_TC_VBS_IFGN_BV_03() runs on ItsVru { - + // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; - } - + } + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { - [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, -, -, -, 2)) { + [] vamPort.receive(mw_vamIndWithGnParameters(mw_vamMsg_any, -, -, -, -, 2)) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected VRU message received encapsulted in GN packet with correct TC value ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } - + // Postamble f_poDefault(); f_cfDown(); - + } // End of function f_TC_VBS_IFGN_BV_03 } // End of group vruLowerLayerParameters @@ -3096,23 +3135,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_TRANS_BV_01() runs on ItsVru { // Local variables - + // Test control if (not PICS_VAM_TRANSMISSION or PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -3125,18 +3164,18 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, -, omit, - omit - ))))) { + omit + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM not containing vruClusterInformationContainer and not containing vruClusterOperationContainer ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -3150,12 +3189,12 @@ module ItsVru_TpFunctions { var VAM v_fisrt_vam; var VAM v_cluster_vam; var VamParameters v_vam_parameters; - + // Test control // Test component configuration f_cfUp_cluster_leader(); - + // Test adapter configuration // Preamble @@ -3165,7 +3204,7 @@ module ItsVru_TpFunctions { ); v_vam_parameters := v_cluster_vam.vam.vamParameters; f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body f_sleep(PX_TNOAC); // Cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed @@ -3177,7 +3216,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -3185,11 +3224,11 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), + ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, @@ -3202,7 +3241,7 @@ module ItsVru_TpFunctions { PX_VRU_CLUSTER_CREATE_RADIUS )), PX_VRU_CLUSTER_CREATE_PROFILE - + ))))))); f_sleep(PX_TNOAC); vamPort.send( @@ -3213,7 +3252,7 @@ module ItsVru_TpFunctions { f_getCurrentTime() mod 65536, m_vam_parameters( m_basic_container( - StationType_bus_, + StationType_bus_, m_reference_position_with_confidence( v_vam_parameters.basicContainer.referencePosition.latitude, v_vam_parameters.basicContainer.referencePosition.longitude, @@ -3221,11 +3260,11 @@ module ItsVru_TpFunctions { v_vam_parameters.basicContainer.referencePosition.altitude )), m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, + v_vam_parameters.vruHighFrequencyContainer.heading, m_speed( v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), + ), v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration ), -, @@ -3243,11 +3282,11 @@ module ItsVru_TpFunctions { -, -, m_cluster_breakup_info( Vru_ClusterBreakupReason_clusteringPurposeCompleted - + ))))))); log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - + // Postamble f_poDefault(); f_cfDown_cluster_leader(); @@ -3255,12 +3294,12 @@ module ItsVru_TpFunctions { function f_TC_VBS_TRANS_BV_02_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble @@ -3268,7 +3307,7 @@ module ItsVru_TpFunctions { // Wait for the cluster creation // Join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -3279,19 +3318,19 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, -, + -, -, -, mw_vru_cluster_information_container - ))))) { + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing vruClusterInformationContainer ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -3305,19 +3344,19 @@ module ItsVru_TpFunctions { function f_TC_VBS_TRANS_BV_03_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble f_prInitialState(); // Wait for the cluster creation f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided)); tc_ac.start; @@ -3329,20 +3368,20 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, -, + -, -, -, omit, mw_vru_cluster_operation_container - ))))) { + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -3356,19 +3395,19 @@ module ItsVru_TpFunctions { function f_TC_VBS_TRANS_BV_04_iut() runs on ItsVru system ItsVruSystem { // Local variables - + // Test control // Test component configuration f_cfUp_iut(); - + // Test adapter configuration // Preamble f_prInitialState(); // Wait for the cluster creation f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided)); tc_ac.start; @@ -3380,20 +3419,20 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, -, + -, -, -, omit, mw_vru_cluster_operation_container - ))))) { + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble // Leave the cluster f_poDefault(); @@ -3412,23 +3451,23 @@ module ItsVru_TpFunctions { */ function f_TC_VBS_CLTR_BV_01() runs on ItsVru { // Local variables - + // Test control if (not PICS_CLUSTERING or PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -3440,18 +3479,18 @@ module ItsVru_TpFunctions { -, mw_vam_parameters( -, -, -, -, -, - omit - ))))) { + omit + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM not containing vruClusterOperationContainer ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_poDefault(); f_cfDown(); @@ -3514,86 +3553,86 @@ module ItsVru_TpFunctions { * @desc TP Function for TC_VBS_SECC_BV_02 */ function f_TC_VBS_SECC_BV_02() runs on ItsVru { - + // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; - } - + } + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { - [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any)) { + [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any)) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected secured VRU message received with correct ITS-AID value ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } - + // Postamble f_poDefault(); f_cfDown(); - + } // End of function f_TC_VBS_SECC_BV_02 /** * @desc TP Function for TC_VBS_SECC_BV_04 */ function f_TC_VBS_SECC_BV_04() runs on ItsVru { - + // Local variables - + // Test control if (not PICS_VAM_GENERATION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_GENERATION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; - } - + } + // Test component configuration f_cfUp(); - + // Test adapter configuration - + // Preamble f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - + // Test Body tc_ac.start; alt { - [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any, ?)) { + [] vamPort.receive(mw_vamIndWithSecurityParameters(mw_vamMsg_any, ?)) { tc_ac.stop; log("*** " & testcasename() & ": PASS: Expected secured VRU message received with SSP value ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } - + // Postamble f_poDefault(); f_cfDown(); - + } // End of function f_TC_VBS_SECC_BV_04 } // End of group securityConstraints -- GitLab From 94ae4668218cc1fd73e05c1c4818cfc149293b01 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 14 Mar 2025 14:25:36 +0100 Subject: [PATCH 16/20] Validate TC_VBS_MSGF_BV_16 --- ItsVru_TestCases.ttcn | 2 +- ItsVru_TpFunctions.ttcn | 52 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index 8da4ee9..d896f0a 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -667,7 +667,7 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_16_cluster_member()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_17_cluster_member()); // Set the IUT in VRU-PASSIVE mode and disband the cluster v_iut.start(f_TC_VBS_MSGF_BV_17_iut()); // Synchronization diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 112a4c7..2d02c95 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -1659,6 +1659,53 @@ module ItsVru_TpFunctions { */ group f_TC_VBS_MSGF_BV_17 { + function f_TC_VBS_MSGF_BV_17_cluster_member() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster_leader(); + + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + // Sent VAM cluster anymore to trigger clusterLeaveReason with clusterDisbandedByLeader + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.vamParameters.vruClusterOperationContainer := valueof( + m_vru_cluster_operation_container( + -, + m_cluster_leave_info( + v_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId, + Vru_clusterLeaveReason_clusterDisbandedByLeader + ))); + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: Disband the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the VAM cluster was disbanded ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_17_cluster_member + function f_TC_VBS_MSGF_BV_17_iut() runs on ItsVru system ItsVruSystem { // Local variables @@ -1671,8 +1718,9 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); - // Wait for the cluster creation - // Join the cluster + f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the IUT to join the cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body -- GitLab From 8f6cb06c12567dbd32ba89be4feda6635de86eb4 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 4 Apr 2025 14:11:05 +0200 Subject: [PATCH 17/20] Validate TC_VBS_TRANS_BV_xx --- ItsVru_TestCases.ttcn | 92 ++-- ItsVru_TpFunctions.ttcn | 655 ++++++++++++++++------------ lib_system/LibItsVru_Functions.ttcn | 28 +- 3 files changed, 443 insertions(+), 332 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index d896f0a..3582baf 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -712,7 +712,7 @@ module ItsVru_TestCases { */ testcase TC_VBS_MSGF_BV_18() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control @@ -723,17 +723,17 @@ module ItsVru_TestCases { } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_18_cluster_member()); // Set the IUT in VRU-PASSIVE mode and move the cluster to put IUT out of box v_iut.start(f_TC_VBS_MSGF_BV_18_iut()); // Synchronization f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of testcase TC_VBS_MSGF_BV_18 @@ -772,7 +772,7 @@ module ItsVru_TestCases { */ testcase TC_VBS_MSGF_BV_19() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control @@ -783,17 +783,17 @@ module ItsVru_TestCases { } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_19_cluster_member()); // Set the IUT in VRU-PASSIVE mode and increase the speed of the cluster to put IUT out of speed v_iut.start(f_TC_VBS_MSGF_BV_19_iut()); // Synchronization f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of testcase TC_VBS_MSGF_BV_19 @@ -832,8 +832,8 @@ module ItsVru_TestCases { */ testcase TC_VBS_MSGF_BV_20() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader_1; - var ItsVru v_vam_cluster_leader_2; + var ItsVru v_vam_cluster_member_1; + var ItsVru v_vam_cluster_member_2; var ItsVru v_iut; // Test control @@ -844,18 +844,18 @@ module ItsVru_TestCases { } // Test component configuration - f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + f_cfMtcUp02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); // Start components - v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode - v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_20_cluster_leader_2()); + v_vam_cluster_member_1.start(f_TC_VBS_MSGF_BV_20_cluster_member_1()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member_2.start(f_TC_VBS_MSGF_BV_20_cluster_member_1()); // Second cluster v_iut.start(f_TC_VBS_MSGF_BV_20_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); + f_cfMtcDown02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); } // End of testcase TC_VBS_MSGF_BV_20 @@ -892,7 +892,8 @@ module ItsVru_TestCases { */ testcase TC_VBS_MSGF_BV_21() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member_1; + var ItsVru v_vam_cluster_member_2; var ItsVru v_iut; // Test control @@ -903,17 +904,18 @@ module ItsVru_TestCases { } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_21_cluster_leader()); // Initiate the cluster + v_vam_cluster_member_1.start(f_TC_VBS_MSGF_BV_21_cluster_member_1()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member_2.start(f_TC_VBS_MSGF_BV_21_cluster_member_1()); // Second cluster v_iut.start(f_TC_VBS_MSGF_BV_21_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); } // End of testcase TC_VBS_MSGF_BV_21 @@ -950,7 +952,8 @@ module ItsVru_TestCases { */ testcase TC_VBS_MSGF_BV_22() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member_1; + var ItsVru v_vam_cluster_member_2; var ItsVru v_iut; // Test control @@ -961,17 +964,18 @@ module ItsVru_TestCases { } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_21_cluster_leader()); // FIXME Seems to be identical to TP/VBS/MSGF/BV-21 - v_iut.start(f_TC_VBS_MSGF_BV_21_iut()); + v_vam_cluster_member_1.start(f_TC_VBS_MSGF_BV_22_cluster_member_1()); // Set the IUT in VRU-PASSIVE mode + v_vam_cluster_member_2.start(f_TC_VBS_MSGF_BV_22_cluster_member_1()); // Second cluster + v_iut.start(f_TC_VBS_MSGF_BV_22_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); } // End of testcase TC_VBS_MSGF_BV_22 @@ -2010,8 +2014,8 @@ module ItsVru_TestCases { var ItsVru v_iut; // Test control - if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { - log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } @@ -2020,11 +2024,11 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_leader, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_TRANS_BV_02_cluster_leader()); + v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); v_iut.start(f_TC_VBS_TRANS_BV_02_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup f_cfMtcDown01(v_vam_cluster_leader, v_iut); @@ -2057,28 +2061,28 @@ module ItsVru_TestCases { */ testcase TC_VBS_TRANS_BV_03() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control - if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { - log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_17_cluster_member()); v_iut.start(f_TC_VBS_TRANS_BV_03_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of TC_VBS_TRANS_BV_03 @@ -2108,28 +2112,28 @@ module ItsVru_TestCases { */ testcase TC_VBS_TRANS_BV_04() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_leader; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control - if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { - log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not(PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration - f_cfMtcUp01(v_vam_cluster_leader, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_leader.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_17_cluster_member()); v_iut.start(f_TC_VBS_TRANS_BV_04_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_cluster_leader, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of TC_VBS_TRANS_BV_04 diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 2d02c95..128703b 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -1483,7 +1483,7 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration @@ -1577,7 +1577,7 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration @@ -1667,7 +1667,7 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration @@ -1764,6 +1764,47 @@ module ItsVru_TpFunctions { */ group f_TC_VBS_MSGF_BV_18 { + function f_TC_VBS_MSGF_BV_18_cluster_member() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster(); + + // Test adapter configuration + + // Preamble + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + // Sent VAM cluster anymore to trigger clusterLeaveReason with outOfClusterBoundingBox + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.latitude := v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.latitude + PX_DELTA_LATITUDE_OUT_OF_BOX; + v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.longitude := v_cluster_vam.vam.vamParameters.basicContainer.referencePosition.longitude + PX_DELTA_LONGITUDE_OUT_OF_BOX; + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: Disband the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_18_cluster_member + function f_TC_VBS_MSGF_BV_18_iut() runs on ItsVru system ItsVruSystem { // Local variables @@ -1821,6 +1862,46 @@ module ItsVru_TpFunctions { */ group f_TC_VBS_MSGF_BV_19 { + function f_TC_VBS_MSGF_BV_19_cluster_member() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster(); + + // Test adapter configuration + + // Preamble + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + // Sent VAM cluster anymore to trigger clusterLeaveReason with outOfClusterSpeedRange + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX; + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: Leave the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of speed range ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_19_cluster_member + function f_TC_VBS_MSGF_BV_19_iut() runs on ItsVru system ItsVruSystem { // Local variables @@ -1878,95 +1959,106 @@ module ItsVru_TpFunctions { */ group f_TC_VBS_MSGF_BV_20 { - function f_TC_VBS_MSGF_BV_20_cluster_leader_2() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_20_cluster_member_1() runs on ItsVru system ItsVruSystem { // Local variables - var VamInd v_fisrt_vam; - var VamParameters v_vam_parameters; + var VAM v_fisrt_vam; + var VAM v_cluster_vam; // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration // Preamble - // Wait for the IUT joining a fisrt cluster before to send a a join cluster better that the previous one - f_sleep(PX_TNOAC); - // Wait for first VA message from the IUT - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - f_getIutStationId(), - mw_vru_awareness( - -, - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container - ))))) -> value v_fisrt_vam { - tc_ac.stop; - log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); - } - } // End of 'alt' statement - // Send VA message covering condition to join the cluster (similar speed, closed position, same direction) - v_vam_parameters := v_fisrt_vam.msgIn.vam.vamParameters; - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.curvature, - v_vam_parameters.vruHighFrequencyContainer.curvatureCalculationMode, - v_vam_parameters.vruHighFrequencyContainer.yawRate, - v_vam_parameters.vruHighFrequencyContainer.lateralAcceleration, - v_vam_parameters.vruHighFrequencyContainer.verticalAcceleration, - v_vam_parameters.vruHighFrequencyContainer.vruLanePosition, - v_vam_parameters.vruHighFrequencyContainer.environment, - v_vam_parameters.vruHighFrequencyContainer.movementControl, - v_vam_parameters.vruHighFrequencyContainer.orientation, - v_vam_parameters.vruHighFrequencyContainer.rollAngle, - v_vam_parameters.vruHighFrequencyContainer.deviceUsage - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID + 1, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - )), - m_vru_cluster_operation_container( - m_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))); - log("*** " & testcasename() & ": INFO: VAM cluster initiated ***"); - // Wait for the IUT to join the cluster + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + } + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX; + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: Disband the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_20_cluster_member_1 + + function f_TC_VBS_MSGF_BV_20_cluster_member_2() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster(); + + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: joiningAnotherCluster the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_20_cluster_member_2 + + function f_TC_VBS_MSGF_BV_20_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + // Join the first cluster + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Join the 2nd cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body tc_ac.start; alt { [] vamPort.receive( @@ -1976,66 +2068,120 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, -, - mw_vru_cluster_information_container, - m_vru_cluster_operation_container( - mw_cluster_join_info( - PX_VRU_CLUSTER_CREATE_ID - ))))))) { + -, -, -, -, + mw_vru_cluster_operation_container( + mw_cluster_join_info( + ? // FIXME FSCOM Set the correct cluster id + ), + mw_cluster_leave_info( + -, + Vru_clusterLeaveReason_joiningAnotherCluster + ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": INFO: IUT joined the cluster ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_joiningAnotherCluster ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: IUT failed to join the cluster ***"); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_MSGF_BV_20_iut + + } // End of group f_TC_VBS_MSGF_BV_20 + + /** + * @desc TP Function for TC_VBS_MSGF_BV_21 + */ + group f_TC_VBS_MSGF_BV_21 { // FIXME To be reviewed + + function f_TC_VBS_MSGF_BV_21_cluster_member_1() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster(); + + // Test adapter configuration + + // Preamble + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + } f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - // Test Body - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - v_vam_parameters.vruHighFrequencyContainer.speed, - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, - PX_VRU_CLUSTER_CREATE_ID + 1, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE + // Test Body + // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX; + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_21_cluster_member_1 + + function f_TC_VBS_MSGF_BV_21_cluster_member_2() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; - ))))))); - log("*** " & testcasename() & ": PASS: VAM better cluster created and existing ***"); + // Test control + + // Test component configuration + f_cfUp_cluster(); + + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: joiningAnotherCluster the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble f_poDefault(); f_cfDown_cluster_leader(); - } - function f_TC_VBS_MSGF_BV_20_iut() runs on ItsVru system ItsVruSystem { + } // End of function f_TC_VBS_MSGF_BV_201_cluster_member_2 + + function f_TC_VBS_MSGF_BV_21_iut() runs on ItsVru system ItsVruSystem { // Local variables // Test control @@ -2048,7 +2194,9 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); // Wait for the cluster creation - // Join the cluster + // Join the first cluster + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Join the 2nd cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body @@ -2063,15 +2211,13 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, -, mw_vru_cluster_operation_container( - mw_cluster_join_info( - ? // FIXME FSCOM Set the correct cluster id - ), + -, mw_cluster_leave_info( -, - Vru_clusterLeaveReason_joiningAnotherCluster + Vru_clusterLeaveReason_cancelledJoin ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_joiningAnotherCluster ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_cancelledJoin ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -2085,16 +2231,16 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown_iut(); - } // End of function f_TC_VBS_MSGF_BV_20_iut + } // End of function f_TC_VBS_MSGF_BV_21_iut - } // End of group f_TC_VBS_MSGF_BV_20 + } // End of group f_TC_VBS_MSGF_BV_21 /** - * @desc TP Function for TC_VBS_MSGF_BV_21 + * @desc TP Function for TC_VBS_MSGF_BV_22 */ - group f_TC_VBS_MSGF_BV_21 { // FIXME To be reviewed + group f_TC_VBS_MSGF_BV_22 { // FIXME To be reviewed - function f_TC_VBS_MSGF_BV_21_cluster_leader() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_22_cluster_member_1() runs on ItsVru system ItsVruSystem { // Local variables var VAM v_fisrt_vam; var VAM v_cluster_vam; @@ -2102,33 +2248,80 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration // Preamble - f_initiate_cluster_iut_as_member( - m_vru_cluster_operation_container( - -, - mw_cluster_leave_info( - -, - Vru_clusterLeaveReason_cancelledJoin - )), - v_fisrt_vam, - v_cluster_vam - ); + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + } f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body - log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX; + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: Disband the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble f_poDefault(); f_cfDown_cluster_leader(); - } - function f_TC_VBS_MSGF_BV_21_iut() runs on ItsVru system ItsVruSystem { + } // End of function f_TC_VBS_MSGF_BV_22_cluster_member_1 + + function f_TC_VBS_MSGF_BV_22_cluster_member_2() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster(); + + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + + // Test Body + // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + f_sleep(1.0); + // TODO Update pathHistory + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + log(v_cluster_vam); + log("*** " & testcasename() & ": INFO: joiningAnotherCluster the cluster ***"); + vamPort.send(m_vruReq(v_cluster_vam)); + } // End of 'for' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_MSGF_BV_201_cluster_member_2 + + function f_TC_VBS_MSGF_BV_22_iut() runs on ItsVru system ItsVruSystem { // Local variables // Test control @@ -2141,7 +2334,9 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); // Wait for the cluster creation - // Join the cluster + // Join the first cluster + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Join the 2nd cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body @@ -2159,10 +2354,10 @@ module ItsVru_TpFunctions { -, mw_cluster_leave_info( -, - Vru_clusterLeaveReason_outOfClusterSpeedRange + Vru_clusterLeaveReason_failedJoin ))))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterSpeedRange ***"); + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_failedJoin ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -2176,9 +2371,9 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown_iut(); - } // End of function f_TC_VBS_MSGF_BV_21_iut + } // End of function f_TC_VBS_MSGF_BV_22_iut - } // End of group f_TC_VBS_MSGF_BV_21 + } // End of group f_TC_VBS_MSGF_BV_22 /** * @desc TP Function for TC_VBS_MSGF_BV_23 @@ -2193,7 +2388,7 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration @@ -2287,7 +2482,7 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration @@ -2451,7 +2646,7 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration @@ -2889,7 +3084,7 @@ module ItsVru_TpFunctions { // Test control // Test component configuration - f_cfUp_cluster_leader(); + f_cfUp_cluster(); // Test adapter configuration @@ -3185,7 +3380,7 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_VAM_TRANSMISSION or PICS_IS_IUT_SECURED) { + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; @@ -3232,114 +3427,6 @@ module ItsVru_TpFunctions { group f_TC_VBS_TRANS_BV_02 { - function f_TC_VBS_TRANS_BV_02_cluster_leader() runs on ItsVru system ItsVruSystem { - // Local variables - var VAM v_fisrt_vam; - var VAM v_cluster_vam; - var VamParameters v_vam_parameters; - - // Test control - - // Test component configuration - f_cfUp_cluster_leader(); - - // Test adapter configuration - - // Preamble - f_create_cluster_iut_as_leader( - v_fisrt_vam, - v_cluster_vam - ); - v_vam_parameters := v_cluster_vam.vam.vamParameters; - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - - // Test Body - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - - ))))))); - f_sleep(PX_TNOAC); - vamPort.send( - m_vruReq( - m_vamMsg( - f_getTsStationId(), - m_vru_awareness( - f_getCurrentTime() mod 65536, - m_vam_parameters( - m_basic_container( - StationType_bus_, - m_reference_position_with_confidence( - v_vam_parameters.basicContainer.referencePosition.latitude, - v_vam_parameters.basicContainer.referencePosition.longitude, - v_vam_parameters.basicContainer.referencePosition.positionConfidenceEllipse, - v_vam_parameters.basicContainer.referencePosition.altitude - )), - m_vru_high_frequency_container( - v_vam_parameters.vruHighFrequencyContainer.heading, - m_speed( - v_vam_parameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX, - v_vam_parameters.vruHighFrequencyContainer.speed.speedConfidence - ), - v_vam_parameters.vruHighFrequencyContainer.longitudinalAcceleration - ), - -, - m_vru_cluster_information_container( - m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY + PX_DELTA_CARDINALITY_CANCEL, - PX_VRU_CLUSTER_CREATE_ID, - m_shape_circular( - m_circular_shape( - PX_VRU_CLUSTER_CREATE_RADIUS - )), - PX_VRU_CLUSTER_CREATE_PROFILE - )), - m_vru_cluster_operation_container( - -, -, - m_cluster_breakup_info( - Vru_ClusterBreakupReason_clusteringPurposeCompleted - - ))))))); - log("*** " & testcasename() & ": PASS: VAM cluster created and terminated ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - // Postamble - f_poDefault(); - f_cfDown_cluster_leader(); - } - function f_TC_VBS_TRANS_BV_02_iut() runs on ItsVru system ItsVruSystem { // Local variables @@ -3354,6 +3441,7 @@ module ItsVru_TpFunctions { f_prInitialState(); // Wait for the cluster creation // Join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body @@ -3403,10 +3491,11 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided)); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body - f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided)); tc_ac.start; alt { [] vamPort.receive( @@ -3424,6 +3513,15 @@ module ItsVru_TpFunctions { log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness + ))) { + log("*** " & testcasename() & ": INFO: Unexpected VAM, skip it ***"); + repeat; + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); @@ -3454,10 +3552,10 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body - f_utTriggerEvent(m_leaveClusterWithCause(Vru_clusterLeaveReason_notProvided)); tc_ac.start; alt { [] vamPort.receive( @@ -3475,6 +3573,15 @@ module ItsVru_TpFunctions { log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness + ))) { + log("*** " & testcasename() & ": INFO: Unexpected VAM, skip it ***"); + repeat; + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: VRU message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); diff --git a/lib_system/LibItsVru_Functions.ttcn b/lib_system/LibItsVru_Functions.ttcn index 9c9f1f4..3a43c1c 100644 --- a/lib_system/LibItsVru_Functions.ttcn +++ b/lib_system/LibItsVru_Functions.ttcn @@ -258,17 +258,17 @@ module LibItsVru_Functions { } // End of function f_cfMtcUp01 function f_cfMtcUp02( - out ItsVru p_vam_cluster_leader_1, - out ItsVru p_vam_cluster_leader_2, + out ItsVru p_vam_cluster_1, + out ItsVru p_vam_cluster_2, out ItsVru p_iut ) runs on ItsBaseMtc { - p_vam_cluster_leader_1 := ItsVru.create("VRU-CLUSTER_LEADER") alive; - p_vam_cluster_leader_2 := ItsVru.create("VRU-CLUSTER_LEADER") alive; + p_vam_cluster_1 := ItsVru.create("VRU-CLUSTER_LEADER") alive; + p_vam_cluster_2 := ItsVru.create("VRU-CLUSTER_LEADER") alive; p_iut := ItsVru.create("VRU-IUT") alive; connect(self:syncPort, mtc:syncPort); - connect(p_vam_cluster_leader_1:syncPort, self:syncPort); - connect(p_vam_cluster_leader_2:syncPort, self:syncPort); + connect(p_vam_cluster_1:syncPort, self:syncPort); + connect(p_vam_cluster_2:syncPort, self:syncPort); connect(p_iut:syncPort, self:syncPort); //connect(p_vam_cluster_leader:infoPort, p_iut:infoPort); @@ -293,22 +293,22 @@ module LibItsVru_Functions { } function f_cfMtcDown02( - out ItsVru p_vam_cluster_leader_1, - out ItsVru p_vam_cluster_leader_2, + out ItsVru p_vam_cluster_1, + out ItsVru p_vam_cluster_2, inout ItsVru p_iut ) runs on ItsBaseMtc { deactivate; disconnect(self:syncPort, mtc:syncPort); - disconnect(p_vam_cluster_leader_1:syncPort, self:syncPort); - disconnect(p_vam_cluster_leader_2:syncPort, self:syncPort); + disconnect(p_vam_cluster_1:syncPort, self:syncPort); + disconnect(p_vam_cluster_2:syncPort, self:syncPort); disconnect(p_iut:syncPort, self:syncPort); //disconnect(p_vam_cluster_leader:infoPort, p_iut:infoPort); - p_vam_cluster_leader_1.done; - p_vam_cluster_leader_2.done; + p_vam_cluster_1.done; + p_vam_cluster_2.done; p_iut.done; } @@ -351,7 +351,7 @@ module LibItsVru_Functions { * @desc Setups default configuration * @param p_certificateId The certificate identifier the TA shall use in case of secured IUT */ - function f_cfUp_cluster_leader() runs on ItsVru system ItsVruSystem { + function f_cfUp_cluster() runs on ItsVru system ItsVruSystem { //map(self:utPort, system:utPort); map(self:acPort, system:acPort); @@ -361,7 +361,7 @@ module LibItsVru_Functions { // Initialise secured mode f_initialiseSecuredMode(); - } // End of function f_cfUp_cluster_leader + } // End of function f_cfUp_cluster /** * @desc Deletes default configuration -- GitLab From 9c74fd12ef21f78cfb01d12d4ecbf8c8aa06002b Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 5 May 2025 10:17:23 +0200 Subject: [PATCH 18/20] Terminate group Frequency/Periodicity range of VAMs --- ItsVru_TestCases.ttcn | 296 ++++++++-- ItsVru_TestControl.ttcn | 9 + ItsVru_TpFunctions.ttcn | 925 +++++++++++++++++++++++++++--- lib/LibItsVru_Pics.ttcn | 10 + lib/LibItsVru_Pixits.ttcn | 20 + lib/LibItsVru_Templates.ttcn | 8 + lib/LibItsVru_TypesAndValues.ttcn | 4 +- 7 files changed, 1147 insertions(+), 125 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index 3582baf..33f6797 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -952,8 +952,7 @@ module ItsVru_TestCases { */ testcase TC_VBS_MSGF_BV_22() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_cluster_member_1; - var ItsVru v_vam_cluster_member_2; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control @@ -964,18 +963,17 @@ module ItsVru_TestCases { } // Test component configuration - f_cfMtcUp02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_member_1.start(f_TC_VBS_MSGF_BV_22_cluster_member_1()); // Set the IUT in VRU-PASSIVE mode - v_vam_cluster_member_2.start(f_TC_VBS_MSGF_BV_22_cluster_member_1()); // Second cluster + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_22_cluster_member()); // Set the IUT in VRU-PASSIVE mode v_iut.start(f_TC_VBS_MSGF_BV_22_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown02(v_vam_cluster_member_1, v_vam_cluster_member_2, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of testcase TC_VBS_MSGF_BV_22 @@ -1025,8 +1023,7 @@ module ItsVru_TestCases { f_cfMtcUp02(v_vam_cluster_leader_1, v_vam_cluster_leader_2, v_iut); // Start components - v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-PASSIVE mode - v_vam_cluster_leader_2.start(f_TC_VBS_MSGF_BV_23_cluster_approching()); + v_vam_cluster_leader_1.start(f_TC_VBS_MSGF_BV_23_cluster_leader()); // Set the IUT in VRU-VRU_ACTIVE_CLUSTER_LEADER mode & raise colliding cluster event v_iut.start(f_TC_VBS_MSGF_BV_23_iut()); // Synchronization @@ -2126,7 +2123,7 @@ module ItsVru_TestCases { f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_17_cluster_member()); + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); v_iut.start(f_TC_VBS_TRANS_BV_04_iut()); // Synchronization @@ -2166,7 +2163,7 @@ module ItsVru_TestCases { */ testcase TC_VBS_CLTR_BV_01() runs on ItsVru system ItsVruSystem { - // TODO f_TC_VBS_CLTR_BV_01(); + f_TC_VBS_CLTR_BV_01(); } // End of TC_VBS_CLTR_BV_01 @@ -2200,28 +2197,28 @@ module ItsVru_TestCases { */ testcase TC_VBS_CLTR_BV_02() runs on ItsBaseMtc system ItsVruSystem { // Local variables - var ItsVru v_vam_initiate_cluster_leader; + var ItsVru v_vam_cluster_member; var ItsVru v_iut; // Test control - if (not(PICS_CLUSTERING and not PICS_IS_IUT_SECURED)) { - log("*** " & testcasename() & ": PICS_CLUSTERING and not PICS_IS_IUT_SECURED required for executing the TC ***"); + if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration - f_cfMtcUp01(v_vam_initiate_cluster_leader, v_iut); + f_cfMtcUp01(v_vam_cluster_member, v_iut); // Start components - /* TODO v_vam_clustev_vam_initiate_cluster_leaderr_leader.start(// TODO f_TC_VBS_CLTR_BV_02_initiate_cluster_leader()); - v_iut.start(// TODO f_TC_VBS_CLTR_BV_02_iut());*/ + v_vam_cluster_member.start(f_TC_VBS_MSGF_BV_15_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER + v_iut.start(f_TC_VBS_CLTR_BV_02_iut()); // Synchronization - f_serverSync2ClientsAndStop({c_prDone, c_tbDone}); + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); // Cleanup - f_cfMtcDown01(v_vam_initiate_cluster_leader, v_iut); + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of TC_VBS_CLTR_BV_02 @@ -2247,9 +2244,9 @@ module ItsVru_TestCases { * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-03 * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 */ - testcase TC_VBS_CLTR_BV_03() runs on ItsBaseMtc system ItsVruSystem { + testcase TC_VBS_CLTR_BV_03() runs on ItsVru system ItsVruSystem { - // TODO f_TC_VBS_CLTR_BV_03(); + f_TC_VBS_CLTR_BV_03(); } // End of TC_VBS_CLTR_BV_03 @@ -2278,8 +2275,29 @@ module ItsVru_TestCases { * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 */ testcase TC_VBS_CLTR_BV_04() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_member; + var ItsVru v_iut; - // TODO f_TC_VBS_CLTR_BV_04(); + // Test control + if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_member, v_iut); + + // Start components + v_vam_cluster_member.start(f_TC_VBS_CLTR_BV_04_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE + v_iut.start(f_TC_VBS_CLTR_BV_04_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of TC_VBS_CLTR_BV_04 @@ -2327,8 +2345,29 @@ module ItsVru_TestCases { * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 */ testcase TC_VBS_CLTR_BV_05() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_member; + var ItsVru v_iut; + + // Test control + if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_member, v_iut); + + // Start components + v_vam_cluster_member.start(f_TC_VBS_CLTR_BV_05_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE + v_iut.start(f_TC_VBS_CLTR_BV_04_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); - // TODO f_TC_VBS_CLTR_BV_05(); + // Cleanup + f_cfMtcDown01(v_vam_cluster_member, v_iut); } // End of TC_VBS_CLTR_BV_05 @@ -2471,39 +2510,232 @@ module ItsVru_TestCases { } // End of TC_VBS_CLTR_BV_10 + } // End of group vruTransitionTriggering + group vruTriggeringCondition { + /** + * @desc Check that the first time individual VAM is generated immediately after VBS activation + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VBS activation has occured
+     *         and VBS has sent no VAM yet
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-01 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_01() runs on ItsVru system ItsVruSystem { + f_TC_VBS_TRCN_BV_01(); + } // End of TC_VBS_TRCN_BV_01 + /** + * @desc Check that a VAM is generated immediately if a VRU is in VRU-IDLE and enters VRU-ACTIVE-STANDALONE + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_02() runs on ItsVru system ItsVruSystem { + f_TC_VBS_TRCN_BV_01(); + } // End of TC_VBS_TRCN_BV_02 + } // End of group vruTriggeringCondition + group vruFrequencyPeriodicity { + + /** + * @desc Check that the minimum time elapsed between the start of consecutive VAM generation events is equal or larger than T_Gen_Vam + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VBS has started generating a VAM at time T1
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VBS starts generating a VAM at time T2
+     *      }
+     *      then {
+     *          T2 - T1 >= T_Gen_Vam
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/TI-01 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2 + */ + testcase TC_VBS_FRPE_TI_01() runs on ItsVru system ItsVruSystem { + f_TC_VBS_FRPE_TI_01(); + } // End of TC_VBS_FRPE_TI_01 + /** + * @desc Check that the LF container is included in the first VAM generation + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VBS activation has occured
+     *         and no VAM has been sent yet
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing vruLowFrequencyContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/BV-02 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_FRPE_BV_02() runs on ItsVru system ItsVruSystem { + f_TC_VBS_FRPE_BV_02(); + } // End of TC_VBS_FRPE_BV_02 + /** + * @desc Check that the LF container is included periodically after 2000 ms + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VBS activation has occured
+     *         and no VAM has been sent yet
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is generated
+     *      }
+     *      then {
+     *          VAM is sent
+     *              containing vruLowFrequencyContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/BV-03 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2 + */ + testcase TC_VBS_FRPE_BV_03() runs on ItsVru system ItsVruSystem { + f_TC_VBS_FRPE_BV_03(); + } // End of TC_VBS_FRPE_BV_03 + /** + * @desc Check that the minimum time elapsed between the start of consecutive VAM generation events is equal or larger than T_Gen_Vam + *
+     * Pics Selection: PICS_VAM_TRANSMISSION and PICS_ITS_G5
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and T_GenVam >= T_GenVamMax 
+     *         and VAM has been sent at time T1
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          next VAM is generated at time T2
+     *      }
+     *      then {
+     *          T2  - T1  = T_GenVamMax
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/TI-04 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2 + */ + testcase TC_VBS_FRPE_TI_04() runs on ItsVru system ItsVruSystem { + f_TC_VBS_FRPE_TI_04(); + } // End of TC_VBS_FRPE_TI_04 + /** + * @desc Check that T_GenVam is set to T_GenVamMin if the value for T_GenVam is not provided by the VBS management entity or smaller than T_GenVamMin in case of ITS-G5 + *
+     * Pics Selection: PICS_VAM_TRANSMISSION and PICS_ITS_G5
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and T_GenVam is not provided
+     *         or T_GenVam <= T_GenVamMin
+     *         and VAM has been sent at time T1
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          next VAM is generated at time T2
+     *      }
+     *      then {
+     *          t2  - t1  = T_GenVamMin
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/FRPE/TI-05 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.2 + */ + testcase TC_VBS_FRPE_TI_05() runs on ItsVru system ItsVruSystem { + f_TC_VBS_FRPE_TI_05(); + } // End of TC_VBS_FRPE_TI_05 - - - - - - } // End of group vruTransitionTriggering - - group vruTriggeringCondition { - } // End of group vruTriggeringCondition + } // End of group vruFrequencyPeriodicity group securityConstraints { diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn index a9cfe90..fa4e2c9 100644 --- a/ItsVru_TestControl.ttcn +++ b/ItsVru_TestControl.ttcn @@ -88,6 +88,15 @@ module ItsVru_TestControl { execute(TC_VBS_TRANS_BV_03()); } execute(TC_VBS_TRANS_BV_04()); + + execute(TC_VBS_TRCN_BV_01()); + execute(TC_VBS_TRCN_BV_02()); + + execute(TC_VBS_FRPE_TI_01()); + execute(TC_VBS_FRPE_BV_02()); + execute(TC_VBS_FRPE_BV_03()); + execute(TC_VBS_FRPE_TI_04()); + execute(TC_VBS_FRPE_TI_05()); } } diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index 128703b..e37aaf1 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -473,6 +473,7 @@ module ItsVru_TpFunctions { */ function f_initiate_cluster_iut_as_member( in template (value) VruClusterOperationContainer p_vru_cluster_operation_container, + in template (value) CardinalNumber1B p_cluster_cardinality := PX_VRU_CLUSTER_CREATE_CARDINALITY, out VAM p_first_iut_vam, // FIXME Seems to be useless out VAM p_updated_cluster_vam ) runs on ItsVru return boolean { @@ -541,7 +542,7 @@ module ItsVru_TpFunctions { -, m_vru_cluster_information_container( m_vru_cluster_information( - PX_VRU_CLUSTER_CREATE_CARDINALITY, + p_cluster_cardinality, PX_VRU_CLUSTER_CREATE_ID, m_shape_circular( m_circular_shape( @@ -2099,7 +2100,7 @@ module ItsVru_TpFunctions { /** * @desc TP Function for TC_VBS_MSGF_BV_21 */ - group f_TC_VBS_MSGF_BV_21 { // FIXME To be reviewed + group f_TC_VBS_MSGF_BV_21 { function f_TC_VBS_MSGF_BV_21_cluster_member_1() runs on ItsVru system ItsVruSystem { // Local variables @@ -2238,50 +2239,9 @@ module ItsVru_TpFunctions { /** * @desc TP Function for TC_VBS_MSGF_BV_22 */ - group f_TC_VBS_MSGF_BV_22 { // FIXME To be reviewed - - function f_TC_VBS_MSGF_BV_22_cluster_member_1() runs on ItsVru system ItsVruSystem { - // Local variables - var VAM v_fisrt_vam; - var VAM v_cluster_vam; - - // Test control - - // Test component configuration - f_cfUp_cluster(); - - // Test adapter configuration - - // Preamble - // Set the IUT in VRU_PASSIVE mode - if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { - f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout); - } else { - f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); - } - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - - // Test Body - // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster - for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { - f_sleep(1.0); - // TODO Update pathHistory - v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue := v_cluster_vam.vam.vamParameters.vruHighFrequencyContainer.speed.speedValue + PX_DELTA_SPEED_OUT_OF_BOX; - v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; - log(v_cluster_vam); - log("*** " & testcasename() & ": INFO: Disband the cluster ***"); - vamPort.send(m_vruReq(v_cluster_vam)); - } // End of 'for' statement - log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and the IUT is out of box ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - - // Postamble - f_poDefault(); - f_cfDown_cluster_leader(); - - } // End of function f_TC_VBS_MSGF_BV_22_cluster_member_1 + group f_TC_VBS_MSGF_BV_22 { - function f_TC_VBS_MSGF_BV_22_cluster_member_2() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_22_cluster_member() runs on ItsVru system ItsVruSystem { // Local variables var VAM v_fisrt_vam; var VAM v_cluster_vam; @@ -2294,32 +2254,30 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble - f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); // Set the IUT in VRU_PASSIVE mode - if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + if (f_initiate_cluster_iut_as_member(m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID, + PX_VRU_REPETITION + )), + PX_VRU_MAX_CLUSTER_SIZE + 1, + v_fisrt_vam, + v_cluster_vam + ) == false) { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } else { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); } // Test Body - // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster - for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { - f_sleep(1.0); - // TODO Update pathHistory - v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; - log(v_cluster_vam); - log("*** " & testcasename() & ": INFO: joiningAnotherCluster the cluster ***"); - vamPort.send(m_vruReq(v_cluster_vam)); - } // End of 'for' statement - log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE ***"); + log("*** " & testcasename() & ": PASS: Initiating cluster creation with invalid cardinality ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble f_poDefault(); f_cfDown_cluster_leader(); - } // End of function f_TC_VBS_MSGF_BV_201_cluster_member_2 + } // End of function f_TC_VBS_MSGF_BV_22_cluster_member function f_TC_VBS_MSGF_BV_22_iut() runs on ItsVru system ItsVruSystem { // Local variables @@ -2334,9 +2292,7 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); // Wait for the cluster creation - // Join the first cluster - f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); - // Join the 2nd cluster + // Joinning cluster f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body @@ -2380,7 +2336,7 @@ module ItsVru_TpFunctions { */ group f_TC_VBS_MSGF_BV_23 { - function f_TC_VBS_MSGF_BV_23_cluster_approching() runs on ItsVru system ItsVruSystem { + function f_TC_VBS_MSGF_BV_23_cluster_leader() runs on ItsVru system ItsVruSystem { // Local variables var VAM v_fisrt_vam; var VAM v_cluster_vam; @@ -2393,18 +2349,25 @@ module ItsVru_TpFunctions { // Test adapter configuration // Preamble - // Set the IUT in VRU-PASSIVE mode - if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode + if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); } else { + log("*** " & testcasename() & ": INFO: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); } // Test Body - f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence - vamPort.send(m_vruReq(v_cluster_vam)); - log("*** " & testcasename() & ": PASS: VAM cluster created and existing ***"); + // f_sleep(PX_TNOAC); + for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { + v_cluster_vam.header.stationId := f_getTsStationId() + 10; + v_cluster_vam.vam.generationDeltaTime := f_getCurrentTime() mod 65536; + v_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId := v_cluster_vam.vam.vamParameters.vruClusterInformationContainer.vruClusterInformation.clusterId + 1 // Same Cluster info with different cluster ID + vamPort.send(m_vruReq(v_cluster_vam)); + f_sleep(0.1); + } // End of 'for' statement + + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble @@ -2414,7 +2377,7 @@ module ItsVru_TpFunctions { f_poDefault(); f_cfDown_cluster_leader(); - } + } // End of function f_TC_VBS_MSGF_BV_23_cluster_leader function f_TC_VBS_MSGF_BV_23_iut() runs on ItsVru system ItsVruSystem { // Local variables @@ -2429,7 +2392,7 @@ module ItsVru_TpFunctions { // Preamble f_prInitialState(); // Wait for the cluster creation - // Join the cluster + // Join the cluster and wait for colliding cluster event raised f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body @@ -2496,7 +2459,7 @@ module ItsVru_TpFunctions { // Test Body f_sleep(PX_TNOAC); - // Cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed + // Bus cluster leader send a VA message to indicate the cluster presence and to indicate cluster completed to the IUT vamPort.send( m_vruReq( m_vamMsg( @@ -3567,7 +3530,7 @@ module ItsVru_TpFunctions { mw_vam_parameters( -, -, -, omit, - mw_vru_cluster_operation_container + omit ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: VAM containing vruClusterOperationContainer ***"); @@ -3608,7 +3571,7 @@ module ItsVru_TpFunctions { // Local variables // Test control - if (not PICS_CLUSTERING or PICS_IS_IUT_SECURED) { + if (not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) { log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); setverdict(inconc); stop; @@ -3637,7 +3600,7 @@ module ItsVru_TpFunctions { omit ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: VAM not containing vruClusterOperationContainer ***"); + log("*** " & testcasename() & ": PASS: VA message sent ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -3654,53 +3617,831 @@ module ItsVru_TpFunctions { group f_TC_VBS_CLTR_BV_02 { + function f_TC_VBS_CLTR_BV_02_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + mw_vru_cluster_information_container( + mw_vru_cluster_information( + PX_VRU_MIN_CLUSTER_SIZE, + -, -, + PX_VRU_CLUSTER_CREATE_PROFILE + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_outOfClusterBoundingBox ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_CLTR_BV_02_iut } // End of group f_TC_VBS_CLTR_BV_02 - group f_TC_VBS_CLTR_BV_03 { + /** + * @desc TP Function for TC_VBS_CLTR_BV_01 + */ + function f_TC_VBS_CLTR_BV_03() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_CLUSTERING or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: VA message received ***"); + // Change state to idle + f_utTriggerEvent(m_setVbsState(0)); + // Wait for stable state + f_sleep(1.0); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VA message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + vamPort.clear; + tc_noac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId() + ))) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: VA message shall not be sent ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_noac.timeout { + log("*** " & testcasename() & ": PASS: No VA message received anymore ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } // End of 'alt' statement + // Postamble + f_poDefault(); + f_cfDown(); - } // End of group f_TC_VBS_CLTR_BV_03 + } // End of function f_TC_VBS_CLTR_BV_03 group f_TC_VBS_CLTR_BV_04 { + function f_TC_VBS_CLTR_BV_04_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; - } // End of group f_TC_VBS_CLTR_BV_04 + // Test control - group f_TC_VBS_CLTR_BV_05 { + // Test component configuration + f_cfUp_cluster(); + // Test adapter configuration - } // End of group f_TC_VBS_CLTR_BV_05 + // Preamble + if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + } + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); - group f_TC_VBS_CLTR_BV_06 { + // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode + // Delete the cluster + f_terminate_cluster(v_cluster_vam); + log("*** " & testcasename() & ": INFO: VAM cluster deleted ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_STANDALONE ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } // End of group f_TC_VBS_CLTR_BV_06 + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); - group f_TC_VBS_CLTR_BV_07 { + } // End of function f_TC_VBS_CLTR_BV_04_cluster_leader + function f_TC_VBS_CLTR_BV_04_iut() runs on ItsVru system ItsVruSystem { + // Local variables - } // End of group f_TC_VBS_CLTR_BV_07 + // Test control - group f_TC_VBS_CLTR_BV_08 { + // Test component configuration + f_cfUp_iut(); + // Test adapter configuration - } // End of group f_TC_VBS_CLTR_BV_08 + // Preamble + f_prInitialState(); + // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the cluster deletion + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); - group f_TC_VBS_CLTR_BV_09 { + // Test Body + f_sleep(1.0); // Wait for stable state + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + omit, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT stops sending VAM cluster ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); - } // End of group f_TC_VBS_CLTR_BV_09 + } // End of function f_TC_VBS_CLTR_BV_04_iut - group f_TC_VBS_CLTR_BV_10 { + } // End of group f_TC_VBS_CLTR_BV_04 + + group f_TC_VBS_CLTR_BV_05 { + function f_TC_VBS_CLTR_BV_05_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; - } // End of group f_TC_VBS_CLTR_BV_10 + // Test control - } // End of group vruTransitionTriggering + // Test component configuration + f_cfUp_cluster(); - group vruTriggeringCondition { - } // End of group vruTriggeringCondition + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + if (f_initiate_cluster_iut_as_member(m_vru_cluster_operation_container( + m_cluster_join_info( + PX_VRU_CLUSTER_CREATE_ID, + PX_VRU_REPETITION + )), + PX_VRU_MAX_CLUSTER_SIZE + 1, + v_fisrt_vam, + v_cluster_vam + ) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); + + // Test Body + log("*** " & testcasename() & ": PASS: VAM cluster is initiated ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + // Delete the cluster + f_terminate_cluster(v_cluster_vam); + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_CLTR_BV_05_cluster_leader + + function f_TC_VBS_CLTR_BV_05_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the cluster deletion + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(1.0); // Wait for stable state + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + omit, + mw_vru_cluster_operation_container( + mw_cluster_join_info + )))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT sends indication of joining a cluster for timeClusterJoinNotification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_CLTR_BV_05_iut + + } // End of group f_TC_VBS_CLTR_BV_05 + + group f_TC_VBS_CLTR_BV_06 { + + + } // End of group f_TC_VBS_CLTR_BV_06 + + group f_TC_VBS_CLTR_BV_07 { + + + } // End of group f_TC_VBS_CLTR_BV_07 + + group f_TC_VBS_CLTR_BV_08 { + + + } // End of group f_TC_VBS_CLTR_BV_08 + + group f_TC_VBS_CLTR_BV_09 { + + + } // End of group f_TC_VBS_CLTR_BV_09 + + group f_TC_VBS_CLTR_BV_10 { + + + } // End of group f_TC_VBS_CLTR_BV_10 + + } // End of group vruTransitionTriggering + + group vruTriggeringCondition { + + /** + * @desc TP Function for TC_VBS_TRCN_BV_01 + */ + function f_TC_VBS_TRCN_BV_01() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: First VAM was sent ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_TRCN_BV_01 + + } // End of group vruTriggeringCondition + + group vruFrequencyPeriodicity { + + /** + * @desc TP Function for TC_VBS_FRPE_TI_01 + */ + function f_TC_VBS_FRPE_TI_01() runs on ItsVru { + // Local variables + timer t_minTransInterval := PICS_T_GEN_VAM * PX_DEC_TIMER_CONTROL_FACTOR; + timer t_maxTransInterval := PICS_T_GEN_VAM * PX_INC_TIMER_CONTROL_FACTOR; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + vamPort.clear; + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + t_minTransInterval.start; + t_maxTransInterval.start; + log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + if (t_minTransInterval.running) { + t_minTransInterval.stop; + t_maxTransInterval.stop; + log("*** " & testcasename() & ": FAIL: VAM received too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + t_maxTransInterval.stop; + log("*** " & testcasename() & ": PASS: VAM received within T_Gen_Vam ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_minTransInterval.timeout { + repeat; + } + [] t_maxTransInterval.timeout { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_Vam ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_FRPE_TI_01 + + /** + * @desc TP Function for TC_VBS_FRPE_BV_02 + */ + function f_TC_VBS_FRPE_BV_02() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container, + -, -, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: First VAM was sent, including vruLowFrequencyContainer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_FRPE_BV_02 + + /** + * @desc TP Function for TC_VBS_FRPE_BV_03 + */ + function f_TC_VBS_FRPE_BV_03() runs on ItsVru { + // Local variables + timer t_minTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_DEC_TIMER_CONTROL_FACTOR; + timer t_maxTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_INC_TIMER_CONTROL_FACTOR; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + vamPort.clear; + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, + ?, + -, -, + omit + ))))) { + tc_ac.stop; + t_minTransInterval.start; + t_maxTransInterval.start; + log("*** " & testcasename() & ": INFO: Initial conditions: First VA message with vruLowFrequencyContainer received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Initial conditions: VA message with vruLowFrequencyContainer not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, + ?, + -, -, + omit + ))))) { + tc_ac.stop; + if (t_minTransInterval.running) { + t_minTransInterval.stop; + t_maxTransInterval.stop; + log("*** " & testcasename() & ": FAIL: VAM with vruLowFrequencyContainer received too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + t_maxTransInterval.stop; + log("*** " & testcasename() & ": PASS: VAM with vruLowFrequencyContainer received within PICS_T_GEN_VAM_LF_MIN ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness + ))) { + log("*** " & testcasename() & ": INFO: VAM w/o vruLowFrequencyContainer received, skip it ***"); + repeat; + } + [] t_minTransInterval.timeout { + repeat; + } + [] t_maxTransInterval.timeout { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + log("*** " & testcasename() & ": FAIL: VAM not received within PICS_T_GEN_VAM_LF_MIN ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_FRPE_BV_03 + + /** + * @desc TP Function for TC_VBS_FRPE_TI_04 + */ + function f_TC_VBS_FRPE_TI_04() runs on ItsVru { + // Local variables + timer t_minTransInterval := PICS_T_GEN_VAM_MAX * PX_DEC_TIMER_CONTROL_FACTOR; + timer t_maxTransInterval := PICS_T_GEN_VAM_MAX * PX_INC_TIMER_CONTROL_FACTOR; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_ITS_G5 or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_ITS_G5 and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + vamPort.clear; + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + t_minTransInterval.start; + t_maxTransInterval.start; + log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + if (t_minTransInterval.running) { + t_minTransInterval.stop; + t_maxTransInterval.stop; + log("*** " & testcasename() & ": FAIL: VAM received too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + t_maxTransInterval.stop; + log("*** " & testcasename() & ": PASS: VAM received within T_Gen_VamMax ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_minTransInterval.timeout { + repeat; + } + [] t_maxTransInterval.timeout { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_VamMax ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_FRPE_TI_04 + + /** + * @desc TP Function for TC_VBS_FRPE_TI_05 + */ + function f_TC_VBS_FRPE_TI_05() runs on ItsVru { + // Local variables + timer t_minTransInterval := PICS_T_GEN_VAM_MIN * PX_DEC_TIMER_CONTROL_FACTOR; + timer t_maxTransInterval := PICS_T_GEN_VAM_MIN * PX_INC_TIMER_CONTROL_FACTOR; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_ITS_G5 or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_ITS_G5 and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + vamPort.clear; + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + t_minTransInterval.start; + t_maxTransInterval.start; + log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + if (t_minTransInterval.running) { + t_minTransInterval.stop; + t_maxTransInterval.stop; + log("*** " & testcasename() & ": FAIL: VAM received too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + t_maxTransInterval.stop; + log("*** " & testcasename() & ": PASS: VAM received within T_Gen_VamMin ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_minTransInterval.timeout { + repeat; + } + [] t_maxTransInterval.timeout { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_VamMin ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_FRPE_TI_05 + + } // End of group vruFrequencyPeriodicity group securityConstraints { diff --git a/lib/LibItsVru_Pics.ttcn b/lib/LibItsVru_Pics.ttcn index 69337e6..199d276 100644 --- a/lib/LibItsVru_Pics.ttcn +++ b/lib/LibItsVru_Pics.ttcn @@ -56,5 +56,15 @@ module LibItsVru_Pics { * @see ETSI TS 104 019-1 Table A.5/1 */ modulepar boolean PICS_IS_IUT_SECURED := false; + + modulepar float PICS_T_GEN_VAM := 1000.0; + + modulepar float PICS_T_GEN_VAM_MIN := 100.0; + + modulepar float PICS_T_GEN_VAM_MAX := 5000.0; + + modulepar float PICS_T_GEN_VAM_LF_MIN := 2000.0; + + modulepar boolean PICS_ITS_G5 := true; } // End of module LibItsVru_Pics \ No newline at end of file diff --git a/lib/LibItsVru_Pixits.ttcn b/lib/LibItsVru_Pixits.ttcn index 7497e20..a04b7fd 100644 --- a/lib/LibItsVru_Pixits.ttcn +++ b/lib/LibItsVru_Pixits.ttcn @@ -27,11 +27,21 @@ module LibItsVru_Pixits { */ modulepar integer PX_VRU_REPETITION := 1; + /** + * @desc Value of minClusterSize + */ + modulepar integer PX_VRU_MIN_CLUSTER_SIZE := 4; + /** * @desc To indicates the cardinality of a cluster initiated by the IUT (>= 3, 3 + the IUT as leader) */ modulepar CardinalNumber1B PX_VRU_CLUSTER_CREATE_CARDINALITY := 4; + /** + * @desc To indicates the cardinality of a cluster initiated by the IUT (>= 3, 3 + the IUT as leader) + */ + modulepar CardinalNumber1B PX_VRU_MAX_CLUSTER_SIZE := 5; + /** * @desc To indicates the cluster ID when initiated by the TS */ @@ -61,4 +71,14 @@ module LibItsVru_Pixits { modulepar UInt32 PX_DELTA_CARDINALITY_CANCEL := 100; + /** + * @desc Multiply timer value by this control factor to increase it + */ + modulepar float PX_INC_TIMER_CONTROL_FACTOR := 1.10; + + /** + * @desc Multiply timer value by this control factor to decrease it + */ + modulepar float PX_DEC_TIMER_CONTROL_FACTOR := 0.9; + } // End of module LibItsVru_Pixits \ No newline at end of file diff --git a/lib/LibItsVru_Templates.ttcn b/lib/LibItsVru_Templates.ttcn index 4ec6d00..ce3af2c 100644 --- a/lib/LibItsVru_Templates.ttcn +++ b/lib/LibItsVru_Templates.ttcn @@ -131,6 +131,14 @@ module LibItsVru_Templates { leaveClusterWithCause := p_leave_cluster_with_cause } + /** + * @desc Set the VRU profile + * @param p_set_vbs_state The VBS state + */ + template (value) UtVamTrigger m_setVbsState(in UInt8 p_set_vbs_state) := { + setVbsState := p_set_vbs_state + } + } // End of group utPrimitives } // End of group Primitives diff --git a/lib/LibItsVru_TypesAndValues.ttcn b/lib/LibItsVru_TypesAndValues.ttcn index 565e106..63d9c77 100644 --- a/lib/LibItsVru_TypesAndValues.ttcn +++ b/lib/LibItsVru_TypesAndValues.ttcn @@ -24,10 +24,12 @@ module LibItsVru_TypesAndValues { * @desc Upper Tester events * @member setVruProfile Set VRU profile * @member leaveClusterWithCause Set VRU profile + * @member setVbsState (0: idle, 1: VRU-ACTIVE-STANDALONE, 2: VRU-ACTIVECLUSTERLEADER, 3: VRU-PASSIVE) See ETSI TS 103 300-3 V2.2.1 Table 5: Possible states of the VRU basic service related to cluster operation */ type union UtVamTrigger { UInt8 setVruProfile, - UInt8 leaveClusterWithCause + UInt8 leaveClusterWithCause, + UInt8 setVbsState } with { variant "" } -- GitLab From 928432406de5a35ee235c2ed08f4addcc877ad4f Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 21 May 2025 14:14:24 +0200 Subject: [PATCH 19/20] Finalyze TSS&TPs document in stable draft (V2.0.4) --- ItsVru_TestCases.ttcn | 417 +++++++++++++++- ItsVru_TestControl.ttcn | 9 + ItsVru_TpFunctions.ttcn | 1037 +++++++++++++++++++++++++++++++++------ lib/LibItsVru_Pics.ttcn | 20 + 4 files changed, 1322 insertions(+), 161 deletions(-) diff --git a/ItsVru_TestCases.ttcn b/ItsVru_TestCases.ttcn index 33f6797..0d7e34a 100644 --- a/ItsVru_TestCases.ttcn +++ b/ItsVru_TestCases.ttcn @@ -983,7 +983,7 @@ module ItsVru_TestCases { * Pics Selection: PICS_VAM_GENERATION and PICS_CLUSTERING * Initial conditions: * with { - * VBS in state VRU-PASSIVE + * VBS in state VRU-ACTIVE-CLUSTER-LEADER * } * Expected behaviour: * ensure that { @@ -2274,7 +2274,7 @@ module ItsVru_TestCases { * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/CLTR/BV-04 * @reference ETSI TS 103 300-3 (V2.2.1), clause 5.4.2.2 */ - testcase TC_VBS_CLTR_BV_04() runs on ItsBaseMtc system ItsVruSystem { + testcase TC_VBS_CLTR_BV_04() runs on ItsBaseMtc system ItsVruSystem { // Local variables var ItsVru v_vam_cluster_member; var ItsVru v_iut; @@ -2574,6 +2574,417 @@ module ItsVru_TestCases { } // End of TC_VBS_TRCN_BV_02 + /** + * @desc Check that a VAM is generated immediately if a VRU is in VRU-PASSIVE, leaves the cluster and enters VRU-ACTIVE-STANDALONE + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VRU leaves cluster
+     *          and state changes to VRU-ACTIVE-STANDALONE
+     *      }
+     *      then {
+     *          VAM is sent
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-03 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_03() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_member; + var ItsVru v_iut; + + // Test control + if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_member, v_iut); + + // Start components + v_vam_cluster_member.start(f_TC_VBS_TRCN_BV_03_cluster_member()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE + v_iut.start(f_TC_VBS_TRCN_BV_03_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_member, v_iut); + + } // End of TC_VBS_TRCN_BV_03 + + /** + * @desc Check that a VAM is generated immediately if a VRU is in VRU-PASSIVE, determines the cluster leader is lost and enters VRU-ACTIVE-STANDALONE + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VRU leaves cluster
+     *          and state changes to VRU-ACTIVE-STANDALONE
+     *      }
+     *      then {
+     *          VAM is sent
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-04 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_04() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_member; + var ItsVru v_iut; + + // Test control + if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_member, v_iut); + + // Start components + v_vam_cluster_member.start(f_TC_VBS_TRCN_BV_04_cluster_member()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE + v_iut.start(f_TC_VBS_TRCN_BV_04_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_member, v_iut); + + } // End of TC_VBS_TRCN_BV_04 + + /** + * @desc Check that a VAM is generated immediately if a VRU is in VRU-ACTIVE-CLUSTER-LEADER, breaks up the cluster and enters VRU-ACTIVE-STANDALONE + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-PASSIVE
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VRU leaves cluster
+     *          and state changes to VRU-ACTIVE-STANDALONE
+     *      }
+     *      then {
+     *          VAM is sent
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-05 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_05() runs on ItsBaseMtc system ItsVruSystem { + // Local variables + var ItsVru v_vam_cluster_leader; + var ItsVru v_iut; + + // Test control + if (not(PICS_CLUSTERING and PICS_IS_IUT_SECURED)) { + log("*** " & testcasename() & ": PICS_CLUSTERING and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfMtcUp01(v_vam_cluster_leader, v_iut); + + // Start components + v_vam_cluster_leader.start(f_TC_VBS_TRCN_BV_05_cluster_leader()); // Set the IUT in VRU-ACTIVE-CLUSTER-LEADER & VRU-ACTIVESTANDALONE + v_iut.start(f_TC_VBS_TRCN_BV_05_iut()); + + // Synchronization + f_serverSync2ClientsAndStop({c_initDone, c_prDone, c_tbDone}); + + // Cleanup + f_cfMtcDown01(v_vam_cluster_leader, v_iut); + + } // End of TC_VBS_TRCN_BV_05 + + /** + * @desc Check that the minimum time elapsed between the start of consecutive VAM generation events is equal or larger than T_Gen_Vam + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VAM has been transmitted at time T1
+     *             not containing vruClusterInformationContainer
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          VAM is transmitted at time T2
+     *              not containing vruClusterInformationContainer
+     *      }
+     *      then {
+     *          T2 - T1 >= T_Gen_Vam
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-06 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_06() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_FRPE_TI_01(); + + } // End of TC_VBS_TRCN_BV_06 + + /** + * @desc Check that consecutive VAM transmissions occur when T_GenVamMax is exceeded + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         or VBS in state VRU-ACTIVE-CLUSTER-LEADER
+     *         and VAM has been transmitted at time T1
+     *         and no other VAM has been sent since then
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          T_GenVamMax is exceeded
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-07 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_07() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_FRPE_TI_04(); + + } // End of TC_VBS_TRCN_BV_07 + + /** + * @desc Check that consecutive individual VAM transmissions occur when the euclidian absolute distance between the current estimated VRU reference point position and the last estimated VRU reference point position exceeds minReferencePointPositonChangeThreshold + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VAM has been transmitted at time T1
+     *             not containing vruClusterInformationContainer
+     *             and containing basicContainer
+     *                 containing referencePosition P1
+     *         and the IUT not having sent any other VAM
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          T_GenVam is exceeded
+     *          and the IUT is alerted about new position value P2
+     *          and euclidian distance (P1, P2) > minReferencePointPositonChangeThreshold 
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-08 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_08() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_TRCN_BV_08(); + + } // End of TC_VBS_TRCN_BV_08 + + /** + * @desc Check that consecutive individual VAM transmissions occur when the euclidian absolute distance between the current estimated VRU reference point position and the last estimated VRU reference point position exceeds minReferencePointPositonChangeThreshold + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VAM has been transmitted at time T1
+     *             not containing vruClusterInformationContainer
+     *             and containing vruHighFrequencyContainer
+     *                 containing speed
+     *                     containing speedValue
+     *                         indcating V1
+     *         and the IUT not having sent any other VAM
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          T_GenVam is exceeded
+     *          and the IUT is alerted about new speed value V2
+     *          and abs(V2 - V1) > minGroundSpeedChangeThreshold
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-09 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_09() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_TRCN_BV_09(); + + } // End of TC_VBS_TRCN_BV_09 + + /** + * @desc Check that consecutive individual VAM transmissions occur when the difference between the orientation of the vector of the current estimated ground velocity of the reference point of the VRU and the estimated orientation of the vector of the ground velocity of the reference point of the VRU lastly included in an individual VAM exceeds minGroundVelocityOrientationChangeThreshold + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VAM has been transmitted at time T1
+     *             not containing vruClusterInformationContainer
+     *             and containing vruHighFrequencyContainer
+     *                 containing heading
+     *                     containing headingValue
+     *                         indcating H1
+     *         and the IUT not having sent any other VAM
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          T_GenVam is exceeded
+     *          and the IUT is alerted about new heading value H2
+     *          and abs(H2 - H1) > minGroundVelocityOrientationChangeThreshold
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-10 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_10() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_TRCN_BV_10(); + + } // End of TC_VBS_TRCN_BV_10 + + /** + * @desc Check that consecutive individual VAM transmissions occur when the difference between the orientation of the vector of the current estimated ground velocity of the reference point of the VRU and the estimated orientation of the vector of the ground velocity of the reference point of the VRU lastly included in an individual VAM exceeds minGroundVelocityOrientationChangeThreshold + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VAM has been transmitted at time T1
+     *             not containing vruClusterInformationContainer
+     *             and containing vruMotionPredictionContainer
+     *                 containing trajectoryInterceptionIndication
+     *                     containing trajectoryInterceptionProbability
+     *                         indicating P1
+     *         and the IUT not having sent any other VAM
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          T_GenVam is exceeded
+     *          and the IUT is alerted about new trajectory interception probability value P2
+     *          and abs(P2 - P1) > minTrajectoryInterceptionProbChangeThreshold
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-11 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_11() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_TRCN_BV_11(); + + } // End of TC_VBS_TRCN_BV_11 + + /** + * @desc Check that consecutive individual VAM transmissions occur when one or more other VRUs are simultanously coming closer than Minimum Safe Lateral Distance(MSLaD) laterally, closer than Minimum Safe Longitudinal Distance (MSLoD) longitudinally and closer than Minimum Safe Vertical Distance (MSVD) vertically + *
+     * Pics Selection: PICS_VAM_TRANSMISSION
+     * Initial conditions:
+     *     with {
+     *         VBS in state VRU-ACTIVE-STANDALONE
+     *         and VAM has been transmitted at time T1
+     *             not containing vruClusterInformationContainer
+     *             and VAM has been received from other VRU
+     *                 containing basicContainer
+     *                     containing referencePosition P1
+     *                         containing latitude 
+     *                             indicating LAT1
+     *                         and containing longitude
+     *                             indicating LON1
+     *             and the IUT not having sent any other VAM
+     *     }
+     * Expected behaviour:
+     *  ensure that {
+     *      when {
+     *          T_GenVam is exceeded
+     *          and the IUT is alerted about new reference position value P1
+     *              containing latitude value LAT2
+     *              and containing longitude value LON2
+     *          and abs(LAT2 - LAT1) < MSLaD
+     *          and abs(LON2 - LON1) < MSLoD
+     *          and euclidian distance (P1, P2) < MSVD
+     *      }
+     *      then {
+     *          VBS sends VAM
+     *              not containing vruClusterInformationContainer
+     *      }
+     *  }
+     * 
+ * + * @see ETSI TS 104 018-2 V2.0.2 (2024-11) TP/VBS/TRCN/BV-12 + * @reference ETSI TS 103 300-3 (V2.2.1), clause 6.4.1 + */ + testcase TC_VBS_TRCN_BV_12() runs on ItsVru system ItsVruSystem { + + f_TC_VBS_TRCN_BV_12(); + + } // End of TC_VBS_TRCN_BV_12 + } // End of group vruTriggeringCondition group vruFrequencyPeriodicity { @@ -2721,7 +3132,7 @@ module ItsVru_TestCases { * next VAM is generated at time T2 * } * then { - * t2 - t1 = T_GenVamMin + * T2 - T1 = T_GenVamMin * } * } * diff --git a/ItsVru_TestControl.ttcn b/ItsVru_TestControl.ttcn index fa4e2c9..5795855 100644 --- a/ItsVru_TestControl.ttcn +++ b/ItsVru_TestControl.ttcn @@ -91,6 +91,15 @@ module ItsVru_TestControl { execute(TC_VBS_TRCN_BV_01()); execute(TC_VBS_TRCN_BV_02()); + execute(TC_VBS_TRCN_BV_03()); + execute(TC_VBS_TRCN_BV_04()); + execute(TC_VBS_TRCN_BV_05()); + execute(TC_VBS_TRCN_BV_06()); + execute(TC_VBS_TRCN_BV_07()); + execute(TC_VBS_TRCN_BV_08()); + execute(TC_VBS_TRCN_BV_09()); + execute(TC_VBS_TRCN_BV_10()); + execute(TC_VBS_TRCN_BV_11()); execute(TC_VBS_FRPE_TI_01()); execute(TC_VBS_FRPE_BV_02()); diff --git a/ItsVru_TpFunctions.ttcn b/ItsVru_TpFunctions.ttcn index e37aaf1..75ef8bb 100644 --- a/ItsVru_TpFunctions.ttcn +++ b/ItsVru_TpFunctions.ttcn @@ -688,6 +688,57 @@ module ItsVru_TpFunctions { log("*** " & testcasename() & ": INFO: VRU simulated cluster terminatted ***"); } // End of function f_terminate_simulated_cluster + /** + * @desc Verifiy 'euclidian distance (P1, P2) > minReferencePointPositonChangeThreshold' + * @param p_p1 Initial position + * @param p_p2 Next position + * @param p_threshold Threshold value for the comparison + * @param p_comparison Comparison operation: -1 is <, 0 is == and 1 is > + * @return true if comparison is verified, false otherwise + */ + function f_verify_euclidian_distance( + in ReferencePositionWithConfidence p_p1, + in ReferencePositionWithConfidence p_p2, + in float p_threshold, + in integer p_comparison + ) return boolean { + return fx_verify_euclidian_distance(p_p1.latitude, p_p1.longitude, p_p2.latitude, p_p2.longitude, p_threshold, p_comparison); + } + + /** + * @desc Verifiy 'abs(V2 - V1) > minGroundSpeedChangeThreshold' + * @param p_p1 Initial speed + * @param p_p2 Next speed + * @param p_threshold Threshold value for the comparison + * @param p_comparison Comparison operation: -1 is <, 0 is == and 1 is > + * @return true if comparison is verified, false otherwise + */ + function f_verify_delta_speed( + in Speed p_speed1, + in Speed p_speed2, + in float p_threshold, + in integer p_comparison + ) return boolean { + return fx_verify_delta(p_speed1.speedValue, p_speed2.speedValue, p_threshold, p_comparison); + } + + /** + * @desc Verifiy 'abs(H2 - H1) > minGroundVelocityOrientationChangeThreshold' + * @param p_p1 Initial heading + * @param p_p2 Next heading + * @param p_threshold Threshold value for the comparison + * @param p_comparison Comparison operation: -1 is <, 0 is == and 1 is > + * @return true if comparison is verified, false otherwise + */ + function f_verify_delta_Wgs84Angle( + in Wgs84Angle p_angle1, + in Wgs84Angle p_angle2, + in float p_threshold, + in integer p_comparison + ) return boolean { + return fx_verify_delta(p_angle1.value_, p_angle2.value_, p_threshold, p_comparison); + } + } // End of group LibHelpers_Functions group message_format { @@ -1982,7 +2033,7 @@ module ItsVru_TpFunctions { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body - // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster + // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { f_sleep(1.0); // TODO Update pathHistory @@ -2023,7 +2074,7 @@ module ItsVru_TpFunctions { } // Test Body - // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster + // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { f_sleep(1.0); // TODO Update pathHistory @@ -2124,7 +2175,7 @@ module ItsVru_TpFunctions { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body - // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster + // Sent VAM cluster anymore to trigger clusterLeaveReason with joiningAnotherCluster for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { f_sleep(1.0); // TODO Update pathHistory @@ -2164,7 +2215,7 @@ module ItsVru_TpFunctions { } // Test Body - // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster + // Sent VAM cluster to trigger clusterLeaveReason with joiningAnotherCluster for (var integer r := 0; r < PX_VRU_REPETITION; r := r + 1) { f_sleep(1.0); // TODO Update pathHistory @@ -2259,9 +2310,9 @@ module ItsVru_TpFunctions { m_cluster_join_info( PX_VRU_CLUSTER_CREATE_ID, PX_VRU_REPETITION - )), + )), PX_VRU_MAX_CLUSTER_SIZE + 1, - v_fisrt_vam, + v_fisrt_vam, v_cluster_vam ) == false) { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); @@ -3643,7 +3694,7 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, -, + -, -, -, mw_vru_cluster_information_container( mw_vru_cluster_information( PX_VRU_MIN_CLUSTER_SIZE, @@ -3805,7 +3856,7 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, -, + -, -, -, omit, omit ))))) { @@ -3848,9 +3899,9 @@ module ItsVru_TpFunctions { m_cluster_join_info( PX_VRU_CLUSTER_CREATE_ID, PX_VRU_REPETITION - )), + )), PX_VRU_MAX_CLUSTER_SIZE + 1, - v_fisrt_vam, + v_fisrt_vam, v_cluster_vam ) == false) { f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); @@ -4003,176 +4054,846 @@ module ItsVru_TpFunctions { } // End of function f_TC_VBS_TRCN_BV_01 - } // End of group vruTriggeringCondition - - group vruFrequencyPeriodicity { + group f_TC_VBS_TRCN_BV_03 { - /** - * @desc TP Function for TC_VBS_FRPE_TI_01 - */ - function f_TC_VBS_FRPE_TI_01() runs on ItsVru { - // Local variables - timer t_minTransInterval := PICS_T_GEN_VAM * PX_DEC_TIMER_CONTROL_FACTOR; - timer t_maxTransInterval := PICS_T_GEN_VAM * PX_INC_TIMER_CONTROL_FACTOR; + function f_TC_VBS_TRCN_BV_03_cluster_member() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; - // Test control - if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); - setverdict(inconc); - stop; - } + // Test control - // Test component configuration - f_cfUp(); + // Test component configuration + f_cfUp_cluster(); - // Test adapter configuration + // Test adapter configuration - // Preamble - f_prInitialState(); - vamPort.clear; - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - f_getIutStationId(), - mw_vru_awareness( - -, - mw_vam_parameters( - -, -, -, -, -, - omit - ))))) { - tc_ac.stop; - t_minTransInterval.start; - t_maxTransInterval.start; - log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***"); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***"); - f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + // Preamble + if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); } - } // End of 'alt' statement + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); - // Test Body - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - f_getIutStationId(), - mw_vru_awareness( - -, - mw_vam_parameters( - -, -, -, -, -, - omit - ))))) { - tc_ac.stop; - if (t_minTransInterval.running) { - t_minTransInterval.stop; - t_maxTransInterval.stop; - log("*** " & testcasename() & ": FAIL: VAM received too early ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - } else { - t_maxTransInterval.stop; - log("*** " & testcasename() & ": PASS: VAM received within T_Gen_Vam ***"); + // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode + // Delete the cluster + f_terminate_cluster(v_cluster_vam); + log("*** " & testcasename() & ": INFO: VAM cluster deleted ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_STANDALONE ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_TRCN_BV_03_cluster_member + + function f_TC_VBS_TRCN_BV_03_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the cluster deletion + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(1.0); // Wait for stable state + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + omit, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT stops sending VAM cluster ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - } - [] t_minTransInterval.timeout { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId() + ))) { + log("*** " & testcasename() & ": INFO: Skip intermediate VA messages ***"); repeat; - } - [] t_maxTransInterval.timeout { - tc_ac.stop; - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_Vam ***"); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement - // Postamble - f_poDefault(); - f_cfDown(); + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); - } // End of function f_TC_VBS_FRPE_TI_01 + } // End of function f_TC_VBS_TRCN_BV_03_iut - /** - * @desc TP Function for TC_VBS_FRPE_BV_02 - */ - function f_TC_VBS_FRPE_BV_02() runs on ItsVru { - // Local variables + } // End of group f_TC_VBS_TRCN_BV_03 - // Test control - if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); - setverdict(inconc); - stop; - } + group f_TC_VBS_TRCN_BV_04 { - // Test component configuration - f_cfUp(); + function f_TC_VBS_TRCN_BV_04_cluster_member() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; - // Test adapter configuration + // Test control - // Preamble - f_prInitialState(); - f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + // Test component configuration + f_cfUp_cluster(); - // Test Body - tc_ac.start; - alt { - [] vamPort.receive( - mw_vamInd( - mw_vamMsg( - f_getIutStationId(), - mw_vru_awareness( - -, - mw_vam_parameters( - -, -, - mw_vru_low_frequency_container, - -, -, - omit - ))))) { - tc_ac.stop; - log("*** " & testcasename() & ": PASS: First VAM was sent, including vruLowFrequencyContainer ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: VRU message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Set the IUT in VRU_PASSIVE mode + if (f_create_cluster_iut_as_member(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); } - } // End of 'alt' statement - // Postamble - f_poDefault(); - f_cfDown(); + // Test Body + // Do not sent VAM cluster anymore to trigger clusterLeaveReason with clusterLeaderLost + log("*** " & testcasename() & ": PASS: IUT is in VRU_PASSIVE and no more VAM cluster sent ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } // End of function f_TC_VBS_FRPE_BV_02 + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); - /** - * @desc TP Function for TC_VBS_FRPE_BV_03 - */ - function f_TC_VBS_FRPE_BV_03() runs on ItsVru { - // Local variables - timer t_minTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_DEC_TIMER_CONTROL_FACTOR; - timer t_maxTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_INC_TIMER_CONTROL_FACTOR; + } // End of function f_TC_VBS_TRCN_BV_04_cluster_member - // Test control - if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { - log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); - setverdict(inconc); - stop; - } + function f_TC_VBS_TRCN_BV_04_iut() runs on ItsVru system ItsVruSystem { + // Local variables - // Test component configuration - f_cfUp(); + // Test control - // Test adapter configuration + // Test component configuration + f_cfUp_iut(); - // Preamble + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_utTriggerEvent(m_setVruProfile(PX_IUT_VRU_PROFILE_TYPE)); + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the IUT to join the cluster + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, + mw_vru_cluster_operation_container( + -, + mw_cluster_leave_info( + -, + Vru_clusterLeaveReason_clusterLeaderLost + ))))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: VAM containing Vru_clusterLeaveReason_clusterLeaderLost ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_TRCN_BV_04_iut + + } // End of group f_TC_VBS_TRCN_BV_04 + + group f_TC_VBS_TRCN_BV_05 { + + function f_TC_VBS_TRCN_BV_05_cluster_leader() runs on ItsVru system ItsVruSystem { + // Local variables + var VAM v_fisrt_vam; + var VAM v_cluster_vam; + + // Test control + + // Test component configuration + f_cfUp_cluster(); + + // Test adapter configuration + + // Preamble + if (f_create_cluster_iut_as_leader(v_fisrt_vam, v_cluster_vam) == false) { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_timeout); + } else { + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + } + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_CLUSTER_LEADER ***"); + + // Set the IUT in VRU_ACTIVE_CLUSTER_LEADER mode + // Delete the cluster + f_terminate_cluster(v_cluster_vam); + log("*** " & testcasename() & ": INFO: VAM cluster deleted ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + log("*** " & testcasename() & ": PASS: IUT is in VRU_ACTIVE_STANDALONE ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Postamble + f_poDefault(); + f_cfDown_cluster_leader(); + + } // End of function f_TC_VBS_TRCN_BV_05_cluster_leader + + function f_TC_VBS_TRCN_BV_05_iut() runs on ItsVru system ItsVruSystem { + // Local variables + + // Test control + + // Test component configuration + f_cfUp_iut(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for the cluster creation + f_selfOrClientSyncAndVerdictPreamble(c_initDone, e_success); + // Wait for the cluster deletion + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + f_sleep(1.0); // Wait for stable state + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, + omit, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT stops sending VAM cluster ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId() + ))) { + log("*** " & testcasename() & ": INFO: Skip intermediate VA messages ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + // Leave the cluster + f_poDefault(); + f_cfDown_iut(); + + } // End of function f_TC_VBS_TRCN_BV_05_iut + + } // End of group f_TC_VBS_TRCN_BV_05 + + /** + * @desc TP Function for TC_VBS_TRCN_BV_08 + */ + function f_TC_VBS_TRCN_BV_08() runs on ItsVru { + // Local variables + var VamInd v_vam; + var VAM v_first_vam; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters + )))) -> value v_vam { + tc_ac.stop; + v_first_vam := v_vam.msgIn; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) -> value v_vam { + tc_ac.stop; + log("*** " & testcasename() & ": INFO: Next VAM was sent ***"); + if (f_verify_euclidian_distance(v_first_vam.vam.vamParameters.basicContainer.referencePosition, v_vam.msgIn.vam.vamParameters.basicContainer.referencePosition, PICS_MIN_REFERENCE_POINT_POSITON_CHANGE_THRESHOLD, 1) == false) { + log("*** " & testcasename() & ": FAIL: euclidian distance (P1, P2) not verified ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + log("*** " & testcasename() & ": PASS: euclidian distance (P1, P2) verified ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_TRCN_BV_08 + + /** + * @desc TP Function for TC_VBS_TRCN_BV_09 + */ + function f_TC_VBS_TRCN_BV_09() runs on ItsVru { + // Local variables + var VamInd v_vam; + var VAM v_first_vam; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters + )))) -> value v_vam { + tc_ac.stop; + v_first_vam := v_vam.msgIn; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) -> value v_vam { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Next VAM was sent ***"); + // Verifiy 'abs(V2 - V1) > minGroundSpeedChangeThreshold' + if (f_verify_delta_speed(v_first_vam.vam.vamParameters.vruHighFrequencyContainer.speed, v_vam.msgIn.vam.vamParameters.vruHighFrequencyContainer.speed, PICS_MIN_GROUND_SPEED_CHANGE_THRESHOLD, 1) == false) { + log("*** " & testcasename() & ": FAIL: abs(V2 - V1) not verified ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + log("*** " & testcasename() & ": PASS: abs(V2 - V1) verified ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_TRCN_BV_09 + + /** + * @desc TP Function for TC_VBS_TRCN_BV_10 + */ + function f_TC_VBS_TRCN_BV_10() runs on ItsVru { + // Local variables + var VamInd v_vam; + var VAM v_first_vam; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters + )))) -> value v_vam { + tc_ac.stop; + v_first_vam := v_vam.msgIn; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) -> value v_vam { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Next VAM was sent ***"); + // Verifiy Verifiy 'abs(H2 - H1) > minGroundVelocityOrientationChangeThreshold' + if (f_verify_delta_Wgs84Angle(v_first_vam.vam.vamParameters.vruHighFrequencyContainer.heading, v_vam.msgIn.vam.vamParameters.vruHighFrequencyContainer.heading, PICS_MIN_GROUND_VELOCITY_ORIENTATION_CHANGE_THRESHOLD, 1) == false) { + log("*** " & testcasename() & ": FAIL: abs(H2 - H1) not verified ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + log("*** " & testcasename() & ": PASS: abs(H2 - H1) verified ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_TRCN_BV_10 + + /** + * @desc TP Function for TC_VBS_TRCN_BV_11 + */ + function f_TC_VBS_TRCN_BV_11() runs on ItsVru { + // Local variables + var VamInd v_vam; + var VAM v_first_vam; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters + )))) -> value v_vam { + tc_ac.stop; + v_first_vam := v_vam.msgIn; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) -> value v_vam { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Next VAM was sent ***"); + // TODO Verifiy 'abs(P2 - P1) > minTrajectoryInterceptionProbChangeThreshold' + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_TRCN_BV_11 + + /** + * @desc TP Function for TC_VBS_TRCN_BV_12 + */ + function f_TC_VBS_TRCN_BV_12() runs on ItsVru { + // Local variables + var VamInd v_vam; + var VAM v_first_vam; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + // Wait for first VA message from the IUT + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters + )))) -> value v_vam { + tc_ac.stop; + v_first_vam := v_vam.msgIn; + log("*** " & testcasename() & ": INFO: VAM from IUT is received ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received from the IUT ***"); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) -> value v_vam { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Next VAM was sent ***"); + // TODO Verifiy 'abs(LAT2 - LAT1) < MSLaD' + // TODO Verifiy 'abs(LON2 - LON1) < MSLoD' + // TODO Verifiy 'euclidian distance (P1, P2) < MSVD' + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_TRCN_BV_12 + + } // End of group vruTriggeringCondition + + group vruFrequencyPeriodicity { + + /** + * @desc TP Function for TC_VBS_FRPE_TI_01 + */ + function f_TC_VBS_FRPE_TI_01() runs on ItsVru { + // Local variables + timer t_minTransInterval := PICS_T_GEN_VAM * PX_DEC_TIMER_CONTROL_FACTOR; + timer t_maxTransInterval := PICS_T_GEN_VAM * PX_INC_TIMER_CONTROL_FACTOR; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + vamPort.clear; + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + t_minTransInterval.start; + t_maxTransInterval.start; + log("*** " & testcasename() & ": INFO: Initial conditions: First VA message received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Initial conditions: VA message not received ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + } // End of 'alt' statement + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, -, -, -, + omit + ))))) { + tc_ac.stop; + if (t_minTransInterval.running) { + t_minTransInterval.stop; + t_maxTransInterval.stop; + log("*** " & testcasename() & ": FAIL: VAM received too early ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + t_maxTransInterval.stop; + log("*** " & testcasename() & ": PASS: VAM received within T_Gen_Vam ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] t_minTransInterval.timeout { + repeat; + } + [] t_maxTransInterval.timeout { + tc_ac.stop; + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + log("*** " & testcasename() & ": FAIL: VAM not received within T_Gen_Vam ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_FRPE_TI_01 + + /** + * @desc TP Function for TC_VBS_FRPE_BV_02 + */ + function f_TC_VBS_FRPE_BV_02() runs on ItsVru { + // Local variables + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] vamPort.receive( + mw_vamInd( + mw_vamMsg( + f_getIutStationId(), + mw_vru_awareness( + -, + mw_vam_parameters( + -, -, + mw_vru_low_frequency_container, + -, -, + omit + ))))) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: First VAM was sent, including vruLowFrequencyContainer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: VRU message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_poDefault(); + f_cfDown(); + + } // End of function f_TC_VBS_FRPE_BV_02 + + /** + * @desc TP Function for TC_VBS_FRPE_BV_03 + */ + function f_TC_VBS_FRPE_BV_03() runs on ItsVru { + // Local variables + timer t_minTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_DEC_TIMER_CONTROL_FACTOR; + timer t_maxTransInterval := PICS_T_GEN_VAM_LF_MIN * PX_INC_TIMER_CONTROL_FACTOR; + + // Test control + if (not PICS_VAM_TRANSMISSION or not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_VAM_TRANSMISSION and PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble f_prInitialState(); vamPort.clear; tc_ac.start; @@ -4184,8 +4905,8 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, - ?, + -, -, + ?, -, -, omit ))))) { @@ -4211,8 +4932,8 @@ module ItsVru_TpFunctions { mw_vru_awareness( -, mw_vam_parameters( - -, -, - ?, + -, -, + ?, -, -, omit ))))) { diff --git a/lib/LibItsVru_Pics.ttcn b/lib/LibItsVru_Pics.ttcn index 199d276..44b954b 100644 --- a/lib/LibItsVru_Pics.ttcn +++ b/lib/LibItsVru_Pics.ttcn @@ -66,5 +66,25 @@ module LibItsVru_Pics { modulepar float PICS_T_GEN_VAM_LF_MIN := 2000.0; modulepar boolean PICS_ITS_G5 := true; + + + + + + modulepar float PICS_MIN_REFERENCE_POINT_POSITON_CHANGE_THRESHOLD := 100.0; + + modulepar float PICS_MIN_GROUND_SPEED_CHANGE_THRESHOLD := 100.0; + + modulepar float PICS_MIN_GROUND_VELOCITY_ORIENTATION_CHANGE_THRESHOLD := 100.0; + + modulepar float PICS_MIN_TRAJECTORY_INTERCEPTION_PROB_CHANGE_THRESHOLD := 100.0; + + modulepar float PICS_MSLAD := 100.0; + + modulepar float PICS_MSLOD := 100.0; + + modulepar float PICS_MSVD := 100.0; + + } // End of module LibItsVru_Pics \ No newline at end of file -- GitLab From ccf334f7fae9212f6d7de7ba46d7d5cb9963b37b Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 9 Jul 2025 09:15:50 +0200 Subject: [PATCH 20/20] Update README with version 2.0.5 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a7ba876..e9caba2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Cooperative Awareness Message TTCN-3 test suite +# Vulnerable Road Users awareness Message TTCN-3 test suite -Cooperative Awareness Message abstract test suite (ATS) as defined in [ETSI TS 102 868-3 v1.5.1](https://www.etsi.org/deliver/etsi_ts/102800_102899/10286803/01.05.01_60/ts_10286803v010501p.pdf) +Vulnerable Road Users awarenes Message abstract test suite (ATS) as defined in [ETSI TS 104 018-3 V2.0.5](https://www.etsi.org/deliver/etsi_ts/102800_102899/10286803/01.05.01_60/ts_10286803v010501p.pdf) This code is a part of the ETSI ITS test suite, available on https://forge.etsi.org/rep/ITS/TS.ITS and cannot be run independently. Please clone the main ETSI ITS test suite repository and compile and follow the compilation instructions. -To run this code, the test suite shall be compiled using `make ATS=AtsCAM` +To run this code, the test suite shall be compiled using `make ATS=AtsVRU` -- GitLab