| 1 |
This is a 2009/wk14 version of NoTA H_IN release 3. |
| 2 |
|
| 3 |
Tested with ubuntu relese 8.10 |
| 4 |
|
| 5 |
H_IN |
| 6 |
==== |
| 7 |
|
| 8 |
H_IN upper layer on NoTA stack. |
| 9 |
|
| 10 |
Dependencies |
| 11 |
------------ |
| 12 |
|
| 13 |
The H_IN core has dependency to following headers: |
| 14 |
- string.h (memcpy, NULL) |
| 15 |
- stdint.h (uint32/uint16/uint8/int32/int16/int8) |
| 16 |
|
| 17 |
The H_IN core does not have any other library dependencies than hplatform. |
| 18 |
|
| 19 |
The H_IN daemon depends on POSIX platform. |
| 20 |
|
| 21 |
|
| 22 |
Building |
| 23 |
-------- |
| 24 |
|
| 25 |
autoreconf -i |
| 26 |
./configure |
| 27 |
make clean all |
| 28 |
sudo make install |
| 29 |
|
| 30 |
|
| 31 |
Daemon (nota_ind) |
| 32 |
================= |
| 33 |
|
| 34 |
link against h_in3 |
| 35 |
|
| 36 |
Daemons purpose is to provide H_IF to AN and SN process trough posix type of daemon trough posix sockets. |
| 37 |
|
| 38 |
example |
| 39 |
------- |
| 40 |
|
| 41 |
you need three terminals A, B and C |
| 42 |
|
| 43 |
|
| 44 |
Terminal A |
| 45 |
h_in/daemon$ ./nota-ind |
| 46 |
|
| 47 |
|
| 48 |
Terminal B |
| 49 |
h_in/test$ .libs/simple_tester_sn |
| 50 |
|
| 51 |
Terminal C |
| 52 |
h_in/test$ .libs/simple_tester_an |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
Single process |
| 57 |
============== |
| 58 |
link against h_in3_sp |
| 59 |
|
| 60 |
Singleprocess uses h_incore directly, and no other process can use the same h_core. |
| 61 |
|
| 62 |
example |
| 63 |
------- |
| 64 |
|
| 65 |
you need two terminals A and B |
| 66 |
|
| 67 |
l_in needs to be configured with actual data bearer like tcp |
| 68 |
|
| 69 |
l_in$ ./configure --with-transports=tcp |
| 70 |
|
| 71 |
|
| 72 |
Terminal A |
| 73 |
h_in/test$ NOTA_LMANAGER=1 .libs/simple_tester_sn_sp |
| 74 |
|
| 75 |
Terminal B |
| 76 |
h_in/test$ .libs/simple_tester_an_sp |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
Multiple reference cores in singleprocess |
| 81 |
----------------------------------------- |
| 82 |
|
| 83 |
Starting 2009/wk14 release NoTA H_IN supports creation of multiple instances of H_IN_core component within a singleprocess. This requires that l_in component is configured also to support multiple reference l_in_ups. |
| 84 |
|
| 85 |
Reason for this feature is that developing and testing of multiple stack within same process. |
| 86 |
|
| 87 |
example with singleprocess l_down |
| 88 |
--------------------------------- |
| 89 |
|
| 90 |
full stack picture |
| 91 |
AN | ref H_IN_sp | ref L_UP | ld_single | ref L_UP | ref H_IN_sp | SN |
| 92 |
|
| 93 |
requires following L_IN configuration. |
| 94 |
|
| 95 |
l_in$ ./configure --with-transports=single --enable-multi-reference-l_in_up |
| 96 |
l_in$ make clean all && sudo make install |
| 97 |
|
| 98 |
requires following h_in configuration. |
| 99 |
|
| 100 |
h_in$ ./configure --enable-multi-reference-h_in_core |
| 101 |
|
| 102 |
and now simple tester an sn single process can be run with |
| 103 |
|
| 104 |
h_in$ test/.libs/simple_tester_an_sn_sp |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
Simple Tester |
| 109 |
============= |
| 110 |
|
| 111 |
Simple tester is test harness to test the h_in features. It is combined from two applications, |
| 112 |
one designed to run on service side, one designed to run on client side. |
| 113 |
|
| 114 |
simple tester is located in h_in/test/simple_tester* |
| 115 |
|
| 116 |
there exists multiple version of simple tester for different purposed. |
| 117 |
|
| 118 |
_sp |
| 119 |
the ones ending with _sp are linked against h_in3_sp and no daemon is run while using |
| 120 |
single process version. Ones not having _sp on their application name are needing nota_ind |
| 121 |
to be runnable. |
| 122 |
|
| 123 |
_an |
| 124 |
The ones having _an in their application name, are having client side features built in. |
| 125 |
Client side features are the options which test cases are to be run. Default action is to |
| 126 |
run all test cases. |
| 127 |
-e 3 4 enables only test cases 3 and 4 |
| 128 |
-d 3 4 disable test cases 3 and 4 and runs everything else |
| 129 |
|
| 130 |
_sn |
| 131 |
The ones having _sn in their application name, are having service side features built, |
| 132 |
mainly means that these can responce to client side requests. |
| 133 |
|
| 134 |
|
| 135 |
Look for the examples in above mentioned configurations options. |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
Branch coverage |
| 141 |
=============== |
| 142 |
|
| 143 |
Branch coverage is used to determine which parts of the code gets run. H_IN in default uses |
| 144 |
'gcov' coverage package included in gcc compiler collection. "--enable-coverage" parameter |
| 145 |
in ./configure scripts enables value "-g -O0 -ftest-coverage -fprofile-arcs -static" is set to |
| 146 |
CFLAGS variable. This generates branching functionalities in compiled code as well as it enables |
| 147 |
linking to gcov library, to enable runtime support of coverage features. To be able to do |
| 148 |
branch coverage in libraries static linking needs to be enabled. |
| 149 |
|
| 150 |
enabling and building |
| 151 |
--------------------- |
| 152 |
|
| 153 |
Coverage is enabled with --enable-coverage flag to configure script. It is recommended |
| 154 |
that possible old files are cleaned with command 'make clean_coverage'. Command 'make clean all' |
| 155 |
cleans binary files and forces coverage support files to be generated. |
| 156 |
|
| 157 |
h_in$ ./configure --enable-coverage |
| 158 |
h_in$ make clean_coverage clean all |
| 159 |
|
| 160 |
After the branch coverage configurations have been done, desired softwares can be run from where the |
| 161 |
h_in branch coverage is aimed to study. |
| 162 |
|
| 163 |
|
| 164 |
gcov results |
| 165 |
------------ |
| 166 |
|
| 167 |
There is a script file to help getting results of coverage run. It requires a directory where to |
| 168 |
store the results as a parameter. The rest of the parameters will be passed to the actual |
| 169 |
gcov call as parameters. |
| 170 |
|
| 171 |
h_in$ ./coverage.sh gcov_result |
| 172 |
|
| 173 |
or for more detail |
| 174 |
|
| 175 |
h_in$ ./coverage.sh gcov_result -b |
| 176 |
|
| 177 |
|
| 178 |
lcov results (in HTML format) |
| 179 |
----------------------------- |
| 180 |
|
| 181 |
lcov_coverage.sh script file helps getting results of coverage run in HTML format. It requires a |
| 182 |
directory where to store the results as a parameter. |
| 183 |
|
| 184 |
h_in$ ./lcov_coverage.sh lcov_result |