summaryrefslogtreecommitdiff
path: root/cesar/cp/eoc/sta/mgr/test/utest/doc
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/cp/eoc/sta/mgr/test/utest/doc')
-rw-r--r--cesar/cp/eoc/sta/mgr/test/utest/doc/Makefile20
-rw-r--r--cesar/cp/eoc/sta/mgr/test/utest/doc/net.txt190
-rw-r--r--cesar/cp/eoc/sta/mgr/test/utest/doc/net_list.txt114
-rw-r--r--cesar/cp/eoc/sta/mgr/test/utest/doc/sta.txt44
-rw-r--r--cesar/cp/eoc/sta/mgr/test/utest/doc/sta_mgr.txt14
-rw-r--r--cesar/cp/eoc/sta/mgr/test/utest/doc/sta_own_data.txt111
6 files changed, 493 insertions, 0 deletions
diff --git a/cesar/cp/eoc/sta/mgr/test/utest/doc/Makefile b/cesar/cp/eoc/sta/mgr/test/utest/doc/Makefile
new file mode 100644
index 0000000000..25c6b6b03d
--- /dev/null
+++ b/cesar/cp/eoc/sta/mgr/test/utest/doc/Makefile
@@ -0,0 +1,20 @@
+PAGES= sta_mgr.txt sta.txt net.txt net_list.txt
+
+ODT=$(PAGES:%.txt=%.odt)
+HTML=$(PAGES:%.txt=%.html)
+
+all: $(ODT) $(HTML)
+
+odt: $(ODT)
+
+html: $(HTML)
+
+%.odt: %.txt
+ rst2odt.py $< $@
+
+%.html: %.txt
+ rst2html $< $@
+
+clean:
+ rm -f $(ODT)
+ rm -f $(HTML)
diff --git a/cesar/cp/eoc/sta/mgr/test/utest/doc/net.txt b/cesar/cp/eoc/sta/mgr/test/utest/doc/net.txt
new file mode 100644
index 0000000000..3424c2ba52
--- /dev/null
+++ b/cesar/cp/eoc/sta/mgr/test/utest/doc/net.txt
@@ -0,0 +1,190 @@
+Network test
+============
+
+Test the APIs available in the cp_net.
+
+sta_add
+-------
+
+Test 1 : Unassociated STAs
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add some station to the net list and verify the data. The STA are added with a
+TEI null and a known mac address.
+
+The Station shall be added as unassociated stations and be added in the set of
+unassociated stations.
+
+Their status shall be equal to CP_STA_STATE_EXISTS.
+The Mac address shall be set.
+
+Test 2 : Associated STAs
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add some stations to the net list and verify the data. The STA are added with
+a TEI different of any one already present in the Net list.
+
+The mac address is not necessary if the TEI is set, the station status shall
+be equal to CP_STA_STATE_ASSOCIATED.
+
+Test 3 : Authenticated STAs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add some authenticated stations to the net list. The STAs are added with a TEI
+different of any one already present in the Net list.
+
+The stations status shall be equal to CP_STA_STATE_AUTHENTICATED.
+
+Test 4 : Modifying the CCo in the NET
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add a station authenticated and set it as a CCo in the AVLN.
+
+The station shall be in the CP_STA_STATE_AUTHENTICATED, and the AVLN shall
+have a pointer to this station in the cco variable.
+
+Test 5 : Modifying the PCo in the NET
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add a station authenticated and set it as a PCo in the AVLN.
+
+The station shall be in the CP_STA_STATE_AUTHENTICATED, and the AVLN shall
+have a pointer to this station in the pco variable.
+
+Remove Sta
+----------
+
+Test 1 : Removing a Associated station (not CCo, not PCo)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add some station and remove it.
+At the end the list must be empty.
+
+Test 2 : Removing the CCo station of the net.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add some station in the net list as associated, one of those stations is the
+CCo (TEI = 3 for examples).
+
+At the beginning of the test, the station with the TEI = 3, shall have its
+status cco flag setted and the network has its cco pointer corresponding to
+this station.
+
+At the end, the station shall not exist in the network and the pointer to the
+CCo in the network shall be null.
+The other stations of the AVLN shall remain present.
+
+Test 3 : Removing the PCo Station of the net.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add some station in the net list as associated, one of those stations is the
+PCo (TEI = 3 for examples).
+
+At the beginning of the test, the station with the TEI = 3, shall have its
+status pco flag setted and the network has its pco pointer corresponding to
+this station.
+
+At the end, the station shall not exist in the network and the pointer to the
+PCo in the network shall be null.
+The other stations of the AVLN shall remain present.
+
+Commit to data plane
+--------------------
+
+Add some station to the list and call the commit to data plane function.
+
+The function of the CL have been overwritten in the cl_stub.c file (see in the
+src directory).
+
+It will normally allocate a block and all the station present in the network
+list will be present in it.
+
++-----+-----+-------+
+| Tag | TEI | MAC @ |
++-----+-----+-------+
+
+Garbage
+-------
+
+Verify the expiration date of all the station in the network. It the network
+is empty it shall post an event in the FSM.
+
+Environment
+~~~~~~~~~~~
+
+Add an AVLN and some station with different status.
+
+Three associated and three not associated stations.
+
++-----+-------+-----+-------+-----------+
+| sta | assoc | tei | mac @ | last seen |
++-----+-------+-----+-------+-----------+
+| 1 | false | 0 | 1 | 5 |
++-----+-------+-----+-------+-----------+
+| 2 | false | 0 | 2 | 7 |
++-----+-------+-----+-------+-----------+
+| 3 | false | 0 | 3 | 9 |
++-----+-------+-----+-------+-----------+
+| 4 | true | 1 | 1 | 6 |
++-----+-------+-----+-------+-----------+
+| 5 | true | 2 | 5 | 8 |
++-----+-------+-----+-------+-----------+
+| 6 | true | 3 | 9 | 10 |
++-----+-------+-----+-------+-----------+
+
+Result
+~~~~~~
+
+The station 1 and the station 4 shall be expired and shall not appear in the
+list after the garbage.
+
+The others shall be still present.
+
+Set slot id
+-----------
+
+Add an AVLN and set the slot id to 5.
+
+Result
+ The slot id shall be equal to 5.
+
+Network mode
+------------
+
+This test case shall test the function to set and get the network mode of an
+AVLN.
+
+Net configuration
+ After the initialization of the network the network mode is CSMA-Only.
+ At the second modification the network mode shall be setted to coordinated mode.
+
+Result
+ The network shall be in CSMA only mode at the first read of the network mode.
+ The network shall be in Coordinated mode at the second read.
+
+Set sta visible
+---------------
+
+This function has for job to set the neighbour station as visible allowing to
+increase or decrease the counter of visible stations in the network.
+
+Test 1 : Adding a STA
+~~~~~~~~~~~~~~~~~~~~~
+
+Environment
+ Add a station to the network and set it as visible.
+
+Result
+ The network shall have one station as visible.
+
+Test 2 : Adding two STAs
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Environment
+ Add two station to the AVLN configured as followed :
+
+ * STA 1 : visible
+ * STA 2 : hidden
+
+Result
+ The network shall have two station and only one visible.
diff --git a/cesar/cp/eoc/sta/mgr/test/utest/doc/net_list.txt b/cesar/cp/eoc/sta/mgr/test/utest/doc/net_list.txt
new file mode 100644
index 0000000000..758b4754b5
--- /dev/null
+++ b/cesar/cp/eoc/sta/mgr/test/utest/doc/net_list.txt
@@ -0,0 +1,114 @@
+Network list
+============
+
+Initialise
+-----------
+
+Shall initialise all the networks list (index greater than 1, the index 0 corresponds to the station AVLN):
+ - present flag shall be false.
+ - snid = 0
+ - nid = 0
+ - cco = null
+ - pco = null
+ - expiration_ntb = CP_NET_EXPIRATION_DELAY (see defs file in cp)
+ - associated_stas shall be empty.
+ - unssociated_stas shall be empty.
+
+The AVLN with the index 0 (the Stations AVLN) shall be present, i.e. the present flag shall be setted.
+
+Uninitialise
+------------
+
+Shall reset all the networks and call on each one the uninit function.
+
+For that some station will be create in each AVLN.
+
+AVLN 0:
+ - Station 1, TEI = 1, Mac @ = 11, is_cco = true.
+ - Station 2, TEI = 2, Mac @ = 12, is_cco = false, is_pco = true.
+
+AVLN 1:
+ - Station 1, TEI = 1, Mac @ = 21, is_cco = true.
+ - Station 2, TEI = 2, Mac @ = 22, is_cco = false, is_pco = true.
+ - Station 3, TEI = 3, Mac @ = 23.
+ - Station 4, TEI = 4, Mac @ = 24.
+
+AVLN 2:
+ - Station 1, TEI = 1, Mac @ = 31, is_cco = true.
+ - Station 2, TEI = 2, Mac @ = 32.
+ - Station 3, TEI = 3, Mac @ = 33.
+ - Station 4, TEI = 4, Mac @ = 34.
+
+At the end of this test case, all the station list shall be empty and the CCo, PCo pointer reseted.
+
+
+Add an AVLN
+-----------
+
+Create the AVLN and verify that it is possible to get it back using the get
+AVLN function.
+
+AVLN data:
+ - SNID = 1
+ - NID = 1
+
+The AVLN returned by the add function shall be in the following state:
+ - SNID = 1
+ - NID = 1
+ - present = true
+ - station_avln = false
+ - cco = null
+ - pco = null
+ - expiration_ntb = CP_NET_EXPIRATION_DELAY (see cp/defs.h)
+ - associated_stas = empty (use set_empty function).
+ - unassociated_stas = empty (use set_empty function).
+
+Remove an AVLN
+--------------
+
+Same thing as uninitializing an AVLN.
+
+Add an AVLN and remove it only using the SNID and NID.
+
+AVLN Data:
+ - SNID = 1
+ - NID = 1.
+
+At the end of the test this AVLN shall not exists.
+
+Update Station's SNID
+---------------------
+
+Modify the AVLN's SNID.
+
+Is empty
+--------
+
+Verify the presence of others AVLN on the medium.
+
+SNID present
+------------
+
+Return a flag indicating which SNID is currently in use.
+
+Environment 3 AVLNs with SNID 1, 5, 10.
+
+At the end of the test the flag shall contain 0x211.
+
+Get slot usage
+--------------
+
+Environment
+
+Result
+ This function shall return 0x94.
+ Add three AVLN in the station manager configured as followed:
+
+ * AVLN 1 : Slot id = 4;
+ * AVLN 2 : Slot id = 7;
+ * AVLN 3 : Slot id = 2;
+
+ This makes a slot usage equal to 0x94.
+
+Result
+ This function shall return 0x94.
diff --git a/cesar/cp/eoc/sta/mgr/test/utest/doc/sta.txt b/cesar/cp/eoc/sta/mgr/test/utest/doc/sta.txt
new file mode 100644
index 0000000000..e711621277
--- /dev/null
+++ b/cesar/cp/eoc/sta/mgr/test/utest/doc/sta.txt
@@ -0,0 +1,44 @@
+Station
+=======
+
+Get tei
+-------
+
+Allow any user to get a copy of the station TEI.
+
+Result
+~~~~~~
+
+Returns the correct value.
+
+Get Mac address
+---------------
+
+Allow any user to get a copy of the Station's Mac address.
+
+Result
+~~~~~~
+
+Returns the correct value.
+
+Get CCo status
+--------------
+
+Allow any user to get a copy of the station CCo status.
+
+Result
+~~~~~~
+
+Returns the correct value.
+
+
+Get PCo status
+---------------
+
+Allow any user to get a copy of the Station's Pco.
+
+Result
+~~~~~~
+
+Returns the correct value.
+
diff --git a/cesar/cp/eoc/sta/mgr/test/utest/doc/sta_mgr.txt b/cesar/cp/eoc/sta/mgr/test/utest/doc/sta_mgr.txt
new file mode 100644
index 0000000000..6fcf407725
--- /dev/null
+++ b/cesar/cp/eoc/sta/mgr/test/utest/doc/sta_mgr.txt
@@ -0,0 +1,14 @@
+Station Manager
+===============
+
+Initialise
+----------
+
+This shall call the function init of the net_list and the init function of the
+STA own data.
+
+Uninitialise
+------------
+
+This will call the uninit function to the net_list and the station own data.
+
diff --git a/cesar/cp/eoc/sta/mgr/test/utest/doc/sta_own_data.txt b/cesar/cp/eoc/sta/mgr/test/utest/doc/sta_own_data.txt
new file mode 100644
index 0000000000..ab302bcdd0
--- /dev/null
+++ b/cesar/cp/eoc/sta/mgr/test/utest/doc/sta_own_data.txt
@@ -0,0 +1,111 @@
+Sta own data
+============
+
+Test the Sta own data private attributes which shall only be modified by the
+accessors.
+
+Status
+------
+
+Tested : under test.
+
+Initialise
+----------
+
+Initialise the private structure (this structure contains the public
+structure) and verify if all the data are setted to 0.
+
+Result
+~~~~~~
+
+- If all the values are equals to 0, the test succeed.
+- If any value is not equal to 0, the test fail.
+
+TEI
+---
+
+Shall update the STA own data to set the station TEI, and modified the Mac
+config structure data referenced in the CP to update the station TEI.
+
+Result
+~~~~~~
+
+- The mac config contains the correct TEI.
+- The station own data contains the correct TEI.
+
+Mac address
+-----------
+
+Shall update the sta own data to set the mac address and modified the mac
+config structure referenced in the CP to update the mac address.
+
+Result
+~~~~~~
+
+- The mac config contains the correct Mac address
+- The station own data contains the correct mac address.
+
+NPW
+---
+
+Shall set up the NPW in the station own data and request the module MSG to
+send a MME to the PLC Driver to store the modification in the flash memory.
+
+*TODO* : Add the API in the MSG module.
+
+Result
+~~~~~~
+
+- The NPW is stored correctly in the STA own data.
+
+NMK
+---
+
+Shall set up the NMK in the station own data and request the module MSG to
+send a MME to the PLC Driver to store the modification in the flash memory.
+
+*TODO* : Add the API in the MSG module.
+
+Result
+~~~~~~
+
+- The NMK is stored correctly in the STA own data.
+
+DPW
+---
+
+Shall set up the DPW in the station own data and request the module MSG to
+send a MME to the PLC Driver to store the modification in the flash memory.
+
+*TODO* : Add the API in the MSG module.
+
+Result
+~~~~~~
+
+- The DPW is stored correctly in the STA own data.
+
+Security level
+--------------
+
+Shall set the security level of the station and send a message to the PLC
+driver to store the SL in the flash memory.
+
+*TODO* : Add the API in the MSG module.
+
+Result
+~~~~~~
+
+- The security level is setted correctly in the station own data.
+
+Was CCo Status
+--------------
+
+Shall set the was CCo status and send a MME to the PLC driver to store the
+station cco status in the flash memory.
+
+*TODO* : Add the API in the MSG module.
+
+Result
+~~~~~~
+
+- The was_cco status is setted in the station own data.