summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilenko Jelisavcic2012-05-17 12:53:14 +0200
committerMilenko Jelisavcic2012-06-04 11:52:22 +0200
commitd7d0f5e659cf7d319c5add527e13003e538cdaab (patch)
tree553c026a007e561f8b00ae059ad58fab573965a1
parent1ea0d08864c25a3c03ff7f542fbb12e489caf8f4 (diff)
cesar/cp/eoc/sta/action/test/utest_eoc[eoc]: fix unitary tests
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/Makefile13
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Config6
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Makefile21
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/inc/context.h79
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/sta/core/core.h49
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/mac/sar/inc/context.h38
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Config8
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Makefile17
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/core_stub.c32
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c48
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c51
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c72
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/phy_stub.c15
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/scenario_actions.c1
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/test_assoc.c48
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/test_scenario.c (renamed from cesar/cp/eoc/sta/action/test/utest_eoc/src/sta_scenario.c)0
-rw-r--r--cesar/cp/eoc/sta/mgr/test/utest/src/sta_mgr.c62
17 files changed, 472 insertions, 88 deletions
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/Makefile b/cesar/cp/eoc/sta/action/test/utest_eoc/Makefile
new file mode 100644
index 0000000000..7478fcf491
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/Makefile
@@ -0,0 +1,13 @@
+all: scenario assoc
+
+scenario: scenario-Makefile
+ make -f scenario-Makefile
+
+assoc: assoc-Makefile
+ make -f assoc-Makefile
+
+clean: scenario-Makefile assoc-Makefile
+ make -f scenario-Makefile clean
+ make -f assoc-Makefile clean
+ rmdir obj
+
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Config b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Config
index e594c45497..7cd6185d05 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Config
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Config
@@ -1,6 +1,8 @@
+CONFIG_CP_EOC = y
CONFIG_DEBUG_FATAL_CATCH = y
-CONFIG_CP_FSM_DEF = "cp/fsm/src/fsm/cp_eoc_sta.fsm"
+CONFIG_CP_FSM_DEF = "cp/eoc/fsm/src/fsm/cp_eoc_sta.fsm"
+CONFIG_CP_EOC_STA_CON_ALLOWED = n
CONFIG_MAC_PBPROC_EOC_FC = y
-CONFIG_CP_MSG_EOC_VS = y
CONFIG_CP_EOC_DBG_PRINT_LEVEL = 0
CONFIG_CP_MSG_EOC_DRV_MME = y
+CONFIG_MAC_COMMON_EOC_SCHED = y
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Makefile b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Makefile
index 92c8fe9f99..853b22f239 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Makefile
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-Makefile
@@ -2,20 +2,19 @@ BASE = ../../../../../..
VARIANT = assoc
-INCLUDES = cp/eoc/sta/action/test/utest_eoc/assoc-override \
- cp/eoc/sta/action/test/utest_eoc
+INCLUDES = cp/eoc/sta/action/test/utest_eoc/assoc-override
-HOST_PROGRAMS = assoc
+HOST_PROGRAMS = test_assoc
-assoc_SOURCES = assoc.c mgr_stub.c core_stub.c cp_stub.c msg_stub.c phy_stub.c
+test_assoc_SOURCES = test_assoc.c mgr_stub.c core_stub.c cp_stub.c msg_stub.c phy_stub.c
-assoc_MODULES = lib cp/sta/mgr mac/common cp/eoc/sta/action \
- cp/fsm/stub cl/stub mac/sar/stub cp/eoc/sta/mgr \
- cp/msg/stub cp/secu cp/beacon/stub bsu/stub cp/eoc/cco/bw/stub
+test_assoc_MODULES = lib mac/common cp/secu \
+ cp/eoc/sta/action cp/eoc/sta/mgr \
+ cp/eoc/fsm/stub cp/eoc/msg/stub cp/eoc/beacon/stub \
+ cp/eoc/cco/bw/stub cl/stub mac/sar/stub bsu/stub \
+ mac/pbproc/stub ce/rx/stub ce/tx/stub
-assoc_CONFIG_MODULES = cp mac cp/msg
-
-cp_sta_mgr_MODULE_SOURCES = net.c sta.c
-cp_eoc_sta_action_MODULE_SOURCES = assoc.c sleep.c poweron.c drv.c
+test_assoc_CONFIG_MODULES = cp cp/eoc mac cl
+test_assoc_LDLIBS = -lm
include $(BASE)/common/make/top.mk
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/inc/context.h b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/inc/context.h
new file mode 100644
index 0000000000..8d1cacdf64
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/inc/context.h
@@ -0,0 +1,79 @@
+#ifndef override_cp_inc_context_h
+#define override_cp_inc_context_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file override/cp/inc/context.h
+ * \brief Control plane context override.
+ * \ingroup test
+ */
+
+//#include "common/std.h"
+#include "lib/rnd.h"
+#include "cp/fsm/fsm.h"
+#include "cp/fsm/inc/context.h"
+#include "cp/inc/trace.h"
+
+#include "cp/cp.h"
+#include "ce/rx/rx.h"
+#include "mac/common/store.h"
+#include "cp/types.h"
+#include "cp/sta/action/inc/context.h"
+#include "cp/sta/mgr/sta_mgr.h"
+#include "cp/sta/mgr/inc/sta_mgr.h"
+#include "mac/common/config.h"
+#include "mac/common/store.h"
+#include "mac/sar/sar.h"
+#include "cl/cl.h"
+#include "cp/msg/inc/context.h"
+#include "mac/pbproc/inc/context.h"
+#include "bsu/aclf/aclf.h"
+
+struct cp_t
+{
+#if CONFIG_TRACE
+ /** Trace context. */
+ trace_buffer_t trace;
+#endif /* CONFIG_TRACE */
+
+ /** FSM context. */
+ cp_fsm_t fsm;
+ /** STA core flag. */
+ bool sta_core_flag;
+ /** STA core urgent flag. */
+ bool sta_core_urgent_flag;
+
+ /** STA action*/
+ cp_sta_action_t sta_action;
+ /** station manager context*/
+ cp_sta_mgr_t sta_mgr;
+ /** MAC config contest*/
+ mac_config_t *mac_config;
+ /** Mac store /dataplane */
+ mac_store_t *mac_store;
+ /** Convergence Layer context */
+ cl_t *cl;
+ /** Segmentation and reassembly context */
+ sar_t *sar;
+ /** Context of the CE in RX. */
+ ce_rx_t *ce_rx;
+ /** Context of the aclf. */
+ bsu_aclf_t *bsu_aclf;
+
+ /** Random generator. */
+ lib_rnd_t rnd;
+
+ /** messages context. */
+ cp_msg_t msg;
+ pbproc_t *pbproc;
+
+ bsu_t *bsu;
+ phy_t *phy;
+};
+
+#endif /* override_cp_inc_context_h */
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/sta/core/core.h b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/sta/core/core.h
new file mode 100644
index 0000000000..50037dbf8e
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/cp/sta/core/core.h
@@ -0,0 +1,49 @@
+#ifndef override_cp_sta_core_core_h
+#define override_cp_sta_core_core_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file override/cp/sta/core/core.h
+ * \brief STA Core override.
+ * \ingroup test
+ */
+#include "cp/types.h"
+#include "cp/fsm/forward.h"
+
+struct cp_sta_core_timed_event_def_t
+{
+};
+
+typedef struct cp_sta_core_timed_event_def_t cp_sta_core_timed_event_def_t;
+
+void
+cp_sta_core_gen_timed_event (
+ cp_t *cp_ctx, cp_sta_core_timed_event_def_t *sta_core_timed_event,
+ cp_fsm_event_t *fsm_event, uint event_delay_ms);
+
+void
+cp_sta_core_stop_timed_or_cyclic_event(
+ cp_t *cp_ctx, cp_sta_core_timed_event_def_t *sta_core_timed_event);
+
+BEGIN_DECLS
+
+void
+cp_sta_core_signal_fsm_event (cp_t *ctx);
+
+void
+cp_sta_core_signal_fsm_urgent_event (cp_t *ctx);
+
+u32
+cp_sta_core_get_date_ms (cp_t *ctx);
+
+void
+cp_sta_core_checkpoint (cp_t *ctx);
+
+END_DECLS
+
+#endif /* override_cp_sta_core_core_h */
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/mac/sar/inc/context.h b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/mac/sar/inc/context.h
new file mode 100644
index 0000000000..9f3d703e62
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/assoc-override/mac/sar/inc/context.h
@@ -0,0 +1,38 @@
+#ifndef cp_eoc_sta_action_test_utest2_override_mac_sar_inc_context_h
+#define cp_eoc_sta_action_test_utest2_override_mac_sar_inc_context_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/eoc/sta/action/test/utest2/override/mac/sar/inc/context_h.h
+ * \brief « brief description »
+ * \ingroup cp_eoc_sta_action_test_utest2_override_mac_sar_inc
+ *
+ * « long description »
+ */
+
+struct sar_stats_t
+{
+ /** Total number of PB received by ourself (from anyone). */
+ u32 rx_pb_count;
+ /** Total number of PB with a CRC error received by ourself (from
+ * anyone). */
+ u32 rx_pb_crc_error_count;
+ /** Total number of PB rejected by SAR. */
+ u32 rx_pb_rejected;
+ /** BER sum of all PBs correct received from any station in the AVLN. */
+ u64 ber_sum;
+};
+typedef struct sar_stats_t sar_stats_t;
+
+struct sar_t
+{
+ mac_store_t *mac_store;
+ sar_stats_t stats;
+};
+
+#endif /* cp_eoc_sta_action_test_utest2_override_mac_sar_inc_context_h */
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Config b/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Config
index 391a6bd3a8..7cd6185d05 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Config
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Config
@@ -1,8 +1,8 @@
+CONFIG_CP_EOC = y
CONFIG_DEBUG_FATAL_CATCH = y
-CONFIG_CP_FSM_DEF = "cp/fsm/src/fsm/cp_eoc_sta.fsm"
+CONFIG_CP_FSM_DEF = "cp/eoc/fsm/src/fsm/cp_eoc_sta.fsm"
+CONFIG_CP_EOC_STA_CON_ALLOWED = n
CONFIG_MAC_PBPROC_EOC_FC = y
-CONFIG_CP_MSG_EOC_VS = y
CONFIG_CP_EOC_DBG_PRINT_LEVEL = 0
CONFIG_CP_MSG_EOC_DRV_MME = y
-CONFIG_CP_BEACON_EOC_SPC_CENTRAL = y
-CONFIG_CL_EOC_ROUTE = y
+CONFIG_MAC_COMMON_EOC_SCHED = y
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Makefile b/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Makefile
index abacc354f9..5dea090185 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Makefile
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/scenario-Makefile
@@ -5,19 +5,18 @@ VARIANT = scenario
INCLUDES = cp/eoc/sta/action/test/utest_eoc/scenario-override \
cp/eoc/sta/action/test/utest_eoc
-HOST_PROGRAMS = sta_scenario
+HOST_PROGRAMS = test_scenario
-sta_scenario_SOURCES = sta_scenario.c scenario_actions.c fsm_stub.c\
+test_scenario_SOURCES = test_scenario.c scenario_actions.c fsm_stub.c\
mgr_stub.c core_stub.c cp_stub.c msg_stub.c phy_stub.c
-sta_scenario_MODULES = lib lib/scenario cp/sta/mgr mac/common cp/eoc/sta/action \
- cp/fsm/stub cl/stub mac/sar/stub cp/eoc/sta/mgr \
- cp/msg/stub cp/secu cp/beacon/stub bsu/stub cp/eoc/cco/bw/stub \
+test_scenario_MODULES = lib lib/scenario cp/eoc/fsm/stub cp/sta/mgr mac/common cp/eoc/sta/action \
+ cl/stub mac/sar/stub cp/eoc/sta/mgr \
+ cp/msg/stub cp/secu cp/beacon/stub bsu/stub cp/eoc/cco/bw/stub mac/pbproc/stub cp/eoc/beacon/stub cp/eoc/msg/stub
-sta_scenario_CONFIG_MODULES = cp mac cp/msg cl
+test_scenario_CONFIG_MODULES = cp cp/eoc mac cl
-cp_sta_mgr_MODULE_SOURCES = net.c sta.c
-cp_eoc_sta_action_MODULE_SOURCES = assoc.c sleep.c poweron.c drv.c
+cp_eoc_sta_action_MODULE_SOURCES = assoc.c poweron.c drv.c assoc_slave.c
+cp_sta_action_MODULE_SOURCES =
include $(BASE)/common/make/top.mk
-
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/core_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/core_stub.c
new file mode 100644
index 0000000000..ba20e6dac6
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/core_stub.c
@@ -0,0 +1,32 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file src/core_stub.c
+ * \brief STA core stub.
+ * \ingroup test
+ */
+#include "common/std.h"
+#include "cp/sta/core/core.h"
+
+void
+cp_sta_core_gen_timed_event (
+ cp_t *cp_ctx, cp_sta_core_timed_event_def_t *sta_core_timed_event,
+ cp_fsm_event_t *fsm_event, uint event_delay_ms)
+{
+ dbg_assert (cp_ctx);
+ dbg_assert (sta_core_timed_event);
+}
+
+void
+cp_sta_core_stop_timed_or_cyclic_event(
+ cp_t *cp_ctx, cp_sta_core_timed_event_def_t *sta_core_timed_event)
+{
+ dbg_assert (cp_ctx);
+ dbg_assert (sta_core_timed_event);
+}
+
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c
new file mode 100644
index 0000000000..672ffb388b
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c
@@ -0,0 +1,48 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file eoc/sta/action/test/utest/src/cp_stub.c
+ * \brief cp/cp.c stub
+ * \ingroup test
+ *
+ */
+#include "common/std.h"
+#include "cp/cp.h"
+#include "cp/mme.h"
+#include "cp/inc/context.h"
+#include "cp/msg/inc/cc_assoc.h"
+
+/**
+ * Compute the NID and the NMK from the network password.
+ * \param ctx the CP context.
+ * \param npw the network password.
+ * \param sl the security level of the station.
+ *
+ * This function will generate the NID and the NMK from the NPW and store it
+ * in the station own data.
+ */
+void
+cp_compute_nmk_and_nid_from_npw (cp_t *ctx, const char *npw,
+ cp_security_level_t sl)
+{
+ u64 nid;
+ cp_key_t nmk;
+ uint length;
+
+ dbg_assert (ctx);
+ dbg_assert (npw);
+
+ length = strlen (npw);
+
+ nmk = cp_secu_npw2nmk (ctx, (const u8*) npw, length);
+ nid = cp_secu_nmk2nid (ctx, nmk, sl);
+
+ /* Store the nid and the nmk to the station own data. */
+ cp_sta_own_data_set_nmk (ctx, nmk, 0);
+ cp_sta_own_data_set_nid (ctx, nid);
+}
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c
new file mode 100644
index 0000000000..46b339d881
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c
@@ -0,0 +1,51 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file eoc/sta/action/test/utest/src/msg_stub.c
+ * \brief cp/sta/mgr/sta_mgr stub
+ * \ingroup test
+ *
+ */
+#include "common/std.h"
+#include "cp/cp.h"
+#include "cp/mme.h"
+#include "cp/inc/context.h"
+#include "cp/msg/inc/cc_assoc.h"
+
+bool
+cp_msg_cc_assoc_cnf_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_msg_cc_assoc_cnf_t *data)
+{
+ dbg_assert (ctx);
+ memset (data, 0, sizeof(cp_msg_cc_assoc_cnf_t));
+ return true;
+}
+
+void
+cp_cco_action_tei_release (cp_t *ctx, u8 tei)
+{
+ dbg_assert (ctx);
+ dbg_assert (tei);
+}
+
+u32
+cp_sta_core_get_date_ms (cp_t *ctx)
+{
+ return 0;
+}
+
+void
+cp_sta_core_checkpoint (cp_t *ctx)
+{
+}
+
+void
+pbproc_activate (pbproc_t *ctx, bool flag)
+{
+}
+
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c
new file mode 100644
index 0000000000..a48f4afb21
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c
@@ -0,0 +1,72 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/msg/src/msg_drv.c
+ * \brief MME Driver.
+ * \ingroup cp_msg
+ *
+ */
+#include "common/std.h"
+#include "common/defs/ethernet.h"
+#include "cp/cp.h"
+#include "cp/mme.h"
+#include "cp/msg/msg.h"
+
+#include "cp/msg/inc/msg_drv.h"
+#include "cp/msg/inc/msg.h"
+
+bool
+cp_msg_drv_sta_set_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_key_t *nmk,
+ enum cp_msg_drv_sta_set_key_type_t *type,
+ cp_nid_t *nid,
+ cp_security_level_t *sl)
+{
+ uint i;
+ dbg_assert (ctx);
+ dbg_assert (mme);
+ dbg_assert (nmk);
+ dbg_assert (type);
+ dbg_assert (nid);
+ dbg_assert (sl);
+
+ if (cp_msg_mme_read_error (ctx, mme))
+ {
+ for (i = 0; i < COUNT (nmk->key); i++)
+ nmk->key[i] = bitstream_read (&mme->bitstream, 32);
+ *type = bitstream_read (&mme->bitstream, 8);
+ *nid = bitstream_read_large (&mme->bitstream, 56);
+ *sl = bitstream_read (&mme->bitstream, 8);
+
+ if ((*type >= CP_MSG_DRV_STA_SET_KEY_TYPE_NB)
+ || (*sl >= CP_SECURITY_LEVEL_NB)
+ || (*nid >> 56))
+ return false;
+ return true;
+ }
+ return false;
+}
+
+bool
+cp_msg_drv_sta_set_dak_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ cp_key_t *dak)
+{
+ uint i;
+ dbg_assert (ctx);
+ dbg_assert (mme);
+ dbg_assert (dak);
+
+ if (cp_msg_mme_read_error (ctx, mme))
+ {
+ for (i = 0; i < COUNT (dak->key); i++)
+ dak->key[i] = bitstream_read (&mme->bitstream, 32);
+
+ return true;
+ }
+ return false;
+}
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/phy_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/phy_stub.c
new file mode 100644
index 0000000000..92ff6578ef
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/phy_stub.c
@@ -0,0 +1,15 @@
+
+
+#include "common/std.h"
+#include "cp/inc/context.h"
+
+
+void
+phy_tx_scale_adapt_exp_set (phy_t *ctx, u8 exp)
+{
+}
+
+void
+phy_tx_scale_adapt_set (phy_t *ctx, u16 value)
+{
+} \ No newline at end of file
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/scenario_actions.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/scenario_actions.c
index 757a60565a..109af4e078 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/src/scenario_actions.c
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/scenario_actions.c
@@ -15,6 +15,7 @@
#include "cp/beacon/beacon.h"
#include "lib/scenario/scenario.h"
#include "cp/eoc/sta/action/assoc.h"
+#include "cp/eoc/sta/action/assoc_slave.h"
void
scenario_action_no_beacons_cb (scenario_globals_t *globals,
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/test_assoc.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/test_assoc.c
new file mode 100644
index 0000000000..737b1d0bf1
--- /dev/null
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/test_assoc.c
@@ -0,0 +1,48 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file eoc/sta/action/test/utest/src/assoc.c
+ * \brief Unit test of sta action after receiving/sending association messages
+ * \ingroup test
+ *
+ * This test checks reception of CC_ASSOC_CNF msg at station side and state
+ * transition depending on result of msg.
+ */
+#include "common/std.h"
+#include "lib/test.h"
+#include "cp/cp.h"
+#include "cp/mme.h"
+#include "cp/inc/context.h"
+
+void
+cp_eoc_sta_action_assoc__associating_cnf (cp_t *ctx, cp_mme_rx_t *mme);
+
+static cp_t cp;
+static cp_mme_rx_t mme;
+
+int
+main (void)
+{
+ test_t test;
+ test_init (test, 0, NULL);
+
+ test_begin (test, "Basic");
+ {
+ cp_eoc_sta_action_assoc__associating_cnf (&cp, &mme);
+ }
+ test_end;
+
+ test_begin (test, "Memory verification")
+ {
+ test_fail_if (blk_check_memory() == false, "Memory not freed");
+ }
+ test_end;
+
+ test_result (test);
+ return test_nb_failed (test) == 0 ? 0 : 1;
+}
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/sta_scenario.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/test_scenario.c
index 30cb7fb5a3..30cb7fb5a3 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/src/sta_scenario.c
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/test_scenario.c
diff --git a/cesar/cp/eoc/sta/mgr/test/utest/src/sta_mgr.c b/cesar/cp/eoc/sta/mgr/test/utest/src/sta_mgr.c
index a24ca25adf..0bcdb83ab6 100644
--- a/cesar/cp/eoc/sta/mgr/test/utest/src/sta_mgr.c
+++ b/cesar/cp/eoc/sta/mgr/test/utest/src/sta_mgr.c
@@ -368,63 +368,6 @@ test_case__cp_sta_mgr_sta (test_t test)
}
test_end;
- test_begin (test, "station Case 2: Change the TEI A to 0, Mac address unchanged")
- {
- cp_t cp;
- cp_net_t *net;
- cp_sta_t *sta;
- cp_sta_t *sta2;
- mac_t mac_addr;
- cp_tei_t sta_tei_A;
- cp_tei_t sta_tei_B;
- mac_config_t mac_config;
-
- /* configuring the test. */
- memset (&cp, 0, sizeof (cp_t));
- memset (&mac_config, 0, sizeof (mac_config_t));
- cp.mac_config=&mac_config;
- mac_addr = 0x12345678ABCull;
-
- sta_tei_A = 0xB;
- sta_tei_B = 0;
-
- lib_stats_init ();
- cp_eoc_sta_mgr_init (&cp);
-
- net = cp_sta_mgr_add_avln (&cp, 1, 1);
- dbg_check (net);
-
- /* Add a station associated. */
- sta = cp_sta_mgr_sta_add (&cp, net, sta_tei_A, mac_addr);
- test_fail_if (sta == NULL);
- test_fail_if (cp_sta_get_tei (sta) != sta_tei_A);
- test_fail_if (cp_sta_get_mac_address (sta) != mac_addr);
-
- test_fail_if (set_empty(&cp.sta_mgr.stas) != false);
- test_fail_if (set_empty(&net->associated_stas) != false);
- test_fail_if (set_empty(&net->unassociated_stas) != true);
-
- /* Add a station with the real TEI. */
- sta2 = cp_sta_mgr_sta_add (&cp, net, sta_tei_B, mac_addr);
- test_fail_if (sta == sta2);
-
- test_fail_if (cp_sta_get_tei (sta2) != sta_tei_B);
- test_fail_if (cp_sta_get_mac_address (sta2) != mac_addr);
-
- test_fail_if (set_empty(&cp.sta_mgr.stas) != false);
- test_fail_if (set_empty(&net->associated_stas) != true);
- test_fail_if (set_empty(&net->unassociated_stas) != false);
-
- /* release the stations. */
- slab_release (sta);
- slab_release (sta2);
-
- cp_sta_mgr_uninit (&cp);
- lib_stats_uninit ();
- }
- test_end;
-
-
test_begin (test, "station Case 4: Change the Mac address from A to bcast")
{
cp_t cp;
@@ -1600,11 +1543,6 @@ test_case__cp_net_num_sta_associated (test_t test)
test_fail_unless (cp_net_num_sta_associated (&cp, net) == 1);
- sta = cp_sta_mgr_sta_add (&cp, net, MAC_TEI_UNASSOCIATED, 1);
- slab_release (sta);
-
- test_fail_unless (cp_net_num_sta_associated (&cp, net) == 0);
-
sta = cp_sta_mgr_sta_add (&cp, net, 2, 1);
slab_release (sta);