1
Using File Service in daemon environment:
2
========================================
3
1) Start daemon (nota-ind -m)
4
2) Start Resource Manager
5
   - Executable can be found from rm/service/ directory.
6
   - Start RM (nota-rmsvc)
7
3) Start File Service
8
   - Executable can be found from /fs/src/ directory.
9
   Start FS (nota_fssvc)
10
4) File Service API can be used for file access.
11
   e.g. File Service tester application can be started (fs/test/). 
12
   The following test tries to create new_file.txt file in /foo/bar/ directory.
13
   ./tester -Cu /foo/bar/new_file.txt
14
15
Nota that File Service API should be used with FS stub. FS stub header files are
16
located in fs/fs_stub/ directory.
17
18
The ontology name and description of File Service can be found from 
19
/fs/fs_stub/common/fileservice.h file. Use these names when asking the Service 
20
ID of File Service from Resource Manager.
21
22
File Service API header file is located in /fs/fs_stub/posix/user/ directory. 
23
Include the CFSAdapter_user.h file to be able to use File Service stub 
24
functions.
25
26
27
The generating of branch coverage report about File Service tests:
28
=================================================================
29
Coverage is enabled with --enable-coverage flag to configure script. It is recommended 
30
that possible old files are cleaned with command 'make clean_coverage'. Command 'make clean all' 
31
cleans binary files and forces coverage support files to be generated.
32
33
1) fs$ ./configure --enable-coverage (terminal 1)
34
   => output includes: CFLAGS ... -fprofile-arcs -ftest-coverage ...
35
      IF fprofile-arcs and ftest_coverage are missing, the branch 
36
         coverage does not work.
37
      => correction: run the following command
38
      fs$ CFLAGS="-g -02 -fprofile-arcs -ftest-coverage" ./configure
39
   
40
2) fs$ make clean_coverage clean all (terminal 1)
41
42
After the branch coverage configurations have been done, the testforfileservice.sh
43
can be run.
44
45
3) fs/test$ sh testforfileservice.sh (terminal 2)
46
47
   and waiting the question and instructions
48
   
49
50
The branch coverage report can be generated by hand as well:
51
===========================================================
52
53
1) same as above (terminal 1)
54
2) same as above (terminal 1)
55
56
3) run tests by hand (terminal 2) e.g.
57
58
   fs/test$NOTA_IN_DAEMON=/tmp/nota-test-1 ./tester -Cfu /tmp/exam.txt
59
   fs/test$NOTA_IN_DAEMON=/tmp/nota-test-1 ./tester -Wu /tmp/exam.txt
60
   fs/test$NOTA_IN_DAEMON=/tmp/nota-test-1 ./tester -Ru /tmp/exam.txt -l 10
61
   fs/test$NOTA_IN_DAEMON=/tmp/nota-test-1 ./tester -Dfu /tmp/exam.txt
62
   
63
4) stop file service server (terminal 1) by writing x<enter>
64
65
after this generate the branch coverage report
66
67
gcov results
68
------------
69
70
There is a script file to help getting results of coverage run. It requires a directory where to
71
store the results as a parameter. The rest of the parameters will be passed to the actual
72
gcov call as parameters.
73
74
5) fs$ ./coverage.sh gcov_result (terminal 1)
75
   
76
or for more detail
77
78
5) fs$ ./coverage.sh gcov_result -b (terminal 1)
79
80
6) fs$ cd gcov_result&&more results
81
82
OR
83
84
lcov results (in HTML format)
85
-----------------------------
86
87
lcov_coverage.sh script file helps getting results of coverage run in HTML format. It requires a 
88
directory where to store the results as a parameter.
89
90
5) fs$ ./lcov_coverage.sh lcov_result
91
92
6) fs$ cd lcov_result
93
94
7) open index.html with html browser (i.e. file:///<absolute path>/fs/lcov_result/index.html)