]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/commitdiff
Updated list of stations test
authorTuka Martin <tukamart@fel.cvut.cz>
Sun, 17 Apr 2011 23:54:56 +0000 (01:54 +0200)
committerTuka Martin <tukamart@fel.cvut.cz>
Sun, 17 Apr 2011 23:54:56 +0000 (01:54 +0200)
Print via ul_logmsg function, synchronized
processes for output

src/fwp/fwp/mngr/fwp_mngr.c
src/fwp/fwp/mngr/test/list_of_stations_test.sh
src/fwp/fwp/mngr/wifi_agent.c
src/fwp/fwp/mngr/wifi_agent_idl.idl
src/fwp/fwp/wifi_agent/wifi_agent_idl.idl

index f4fea8e76d97877ff99ef161b4d651796a1f9518..f3ac97cd4aa6f6f9926a12fb84c9c11902e82945 100644 (file)
@@ -50,8 +50,6 @@
 #include <getopt.h>
 #include <fres_sa_scenario.h>
 #include <stdbool.h>
-#include <ul_list.h>
-#include <ul_log.h>
 #include <ul_logreg.h>
 #include <fwp_res.h>
 #include <stdio.h>
index 9d2cd7c5f360aed951df267e4de37ba74c312a09..94a5ac9c00eff3d052d10c03e029ac4d65c6d48b 100755 (executable)
@@ -10,26 +10,30 @@ wvtest_cleanup() {
 WVPASS fcb -dfcb.pid
 
 cat > expected << EOF
-Actual list of stations
-120976291 - 10
+Actual_list_of_stations
+120976291_-_10
 ------------
 
-Actual list of stations
-120976291 - 12
-80976291 - 21
+Actual_list_of_stations
+120976291_-_12
+80976291_-_21
 ------------
 
-Actual list of stations
-120976291 - 12
-80976291 - 64
-80945292 - 64
+Actual_list_of_stations
+120976291_-_12
+80976291_-_64
+80945292_-_64
 ------------
 
 EOF
 
-#TODO: Synchronize processes for correct output
-WVPASS sh -c "frm_fwp > actual"
-WVPASS list_of_stations_test
-WVPASS diff -u expected actual
-
+(WVPASS sh -c "frm_fwp 2> actual" & FWP_PID=$!
+wait $LIS_PID
+kill $FWP_PID $LIS_PID) &
+(
+#sleep 1;
+WVPASS list_of_stations_test & LIS_PID=$!; 
+WVPASS cut -d' ' -f4 actual > actual_just_outputs;
+WVPASS diff -u expected actual_just_outputs;
+)
 
index 2e3ed27a714659101b9aae5f53bc9b2a5398c3bb..de0badb79c9a4627a485da42ba2801cee74dd90f 100644 (file)
 #include "wifi_agent_idl.h"
 #include "fwp_admctrl.h"
 
+UL_LOG_CUST(ulogd_frm_fwp);
+ul_log_domain_t ulogd_frm_fwp = {UL_LOGL_MSG, "main"};
+UL_LOGREG_SINGLE_DOMAIN_INIT_FUNCTION(init_ulogd_frm_fwp, ulogd_frm_fwp);
+
 struct forb_wifi_agent_idl_impl wifi_agent_impl = {
        .add = wifi_agent_idl_add,
        .print_state = wifi_agent_idl_print_state,
@@ -26,12 +30,11 @@ void wifi_agent_idl_print_state(wifi_agent_idl _obj, CORBA_Environment *ev)
 {
        fwp_sta_t *sta2;
 
-       printf("Actual list of stations\n");
+       ul_logmsg("Actual_list_of_stations\n");
        ul_list_for_each(sta_list, &priv.sta_list, sta2){
-               printf("%llu -", sta2->client_mac_addr);        
-               printf(" %d\n", sta2->rate);
+               ul_logmsg("%llu_-_%d\n", sta2->client_mac_addr, sta2->rate);
        }
-       printf("------------\n\n");
+       ul_logmsg("------------\n\n");
 }
 
 /**
index 9838ab047bf67a0a723ceccff1dd9e01b8971126..6e103614aaf6c3411a3519617921fb4369c21385 100644 (file)
@@ -6,5 +6,4 @@ struct fwp_sta {
 interface wifi_agent_idl {
         long add(in long rate, in long long client_mac_addr);
        void print_state();
-        //void get_last(out long rate, out string client_mac_addr);
 };
index 9838ab047bf67a0a723ceccff1dd9e01b8971126..6e103614aaf6c3411a3519617921fb4369c21385 100644 (file)
@@ -6,5 +6,4 @@ struct fwp_sta {
 interface wifi_agent_idl {
         long add(in long rate, in long long client_mac_addr);
        void print_state();
-        //void get_last(out long rate, out string client_mac_addr);
 };