Newer
Older
# Test Specification
Most of the functionality in *dslmngr* can be tested via its UBUS API. Each
API can be broken down into an individual test case to show full coverage is
achieved.
## Prerequisites
The only prerequisite for the *dslmngr* test suites is that *libdsl* has to be
built for the TEST platform, returning dummy data for getter APIs.
## Test Suites
The *dslmngr* build pipe has three test suites, a functional-api suite, a unit
test suite and a functional test suite.
### Functional API Tests
The functional API test suite consists of eight test cases verifying output of
status and statistics returned by UBUS calls. *dslmngr* and ubusd are started
before the whole test cases' invoke. Each test case issues a UBUS call and saves
the output to a temporary file. Then the contents of the file are analyzed by
using JSON-C library APIs.
#### dsl.line.<number>
| Execution ID | Method | Description | Function ID Coverage |
| :--- | :--- | :--- | :--- |
| 1 | status | No argument | [1](./api/dsl.line.md#status) |
| 2 | stats | No argument | [2](./api/dsl.line.md#stats) |
| 3 | stats | Interval | [3](./api/dsl.line.md#stats_interval) |
| 9 | configure | DSL_config | [9](./api/dsl.line.md#configure) |
#### dsl.channel.<number>
| Execution ID | Method | Description | Function ID Coverage |
| :--- | :--- | :--- | :--- |
| 4 | status | No argument | [4](./api/dsl.channel.md#status) |
| 5 | stats | No argument | [5](./api/dsl.channel.md#stats) |
| 6 | stats | Interval | [6](./api/dsl.channel.md#stats_interval) |
#### dsl
| Execution ID | Method | Description | Function ID Coverage |
| :--- | :--- | :--- | :--- |
| 7 | status | No argument | [7](./api/dsl.md#status) |
| 8 | stats | No argument | [8](./api/dsl.md#stats) |
#### fast.line.<number>
| Execution ID | Method | Description | Function ID Coverage |
| :--- | :--- | :--- | :--- |
| 10 | status | No argument | [10](./api/fast.line.md#status) |
| 11 | stats | No argument | [11](./api/fast.line.md#stats) |
| 12 | stats | Interval | [12](./api/fast.line.md#stats_interval) |
#### atm.link.<number>
| Execution ID | Method | Description | Function ID Coverage |
| :--- | :--- | :--- | :--- |
| 13 | status | No argument | [13](./api/atm.link.md#status) |
| 14 | stats | No argument | [14](./api/atm.link.md#stats) |
| 15 | configure | ATM_config | [15](./api/atm.link.md#configure) |
#### ptm.link.<number>
| Execution ID | Method | Description | Function ID Coverage |
| :--- | :--- | :--- | :--- |
| 16 | status | No argument | [16](./api/ptm.link.md#status) |
### Unit Tests
The *dslmngr* unit tests are written in CMocka, invoking the UBUS callbacks directly from the source code, which is compiled
into a shared library. This means mocking the arguments of a CLI or libubus invoke in a `struct blob_attr *`.
The output of the UBUS callbacks are retrieved by manipulation of the function ubus_send_reply(). Then the output is analyzed
and verified by each test case.
| Execution ID | Method | Test Case Name | Function ID Coverage |
| 1 | line_status | test_api_dsl_line_status | [1](./api/dsl.line.md#status) |
| 2 | line_stats | test_api_dsl_line_stats | [2](./api/dsl.line.md#stats) |
| 3 | line_stats_interval | test_api_dsl_line_stats_interval | [3](./api/dsl.line.md#stats_interval) |
| 4 | channel_status | test_api_dsl_channel_status | [4](./api/dsl.channel.md#status) |
| 5 | channel_stats | test_api_dsl_channel_stats | [5](./api/dsl.channel.md#stats) |
| 6 | channel_stats_interval | test_api_dsl_channel_stats_interval | [6](./api/dsl.channel.md#stats_interval) |
| 7 | dsl_status | test_api_dsl_status | [7](./api/dsl.md#status) |
| 8 | dsl_stats | test_api_dsl_stats | [8](./api/dsl.md#stats) |
| 9 | dsl_configure | test_api_dsl_configure | [9](./api/dsl.line.md#configure) |
| 10 | dsl_configure_fail | test_api_dsl_configure_fail | [9](./api/dsl.line.md#configure) |
| 11 | atm_configure | test_api_atm_configure | [15](./api/atm.link.md#configure) |
| 12 | atm_configure_fail | test_api_atm_configure_fai | [15](./api/atm.link.md#configure) |
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#### test_api_dsl_line_status
##### Description
Test the *dslmngr* UBUS API callback `dsl_line_status()`, providing the method [line status](./api/dsl.line.md#status).
##### Test Steps
- Call `dsl_line_status()`
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
#### test_api_dsl_line_stats
##### Description
Test the *dslmngr* UBUS API callback `dsl_line_stats()`, providing the method [line stats](./api/dsl.line.md#stats).
##### Test Steps
- Call `dsl_line_stats()`
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
#### test_api_dsl_line_stats_interval
##### Description
Test the *dslmngr* UBUS API callback `dsl_line_stats()`, providing the method [line stats](./api/dsl.line.md#stats).
##### Test Steps
- Call `dsl_line_stats()` with intervals `total`, `showtime`, `lastshowtime`, `currentday`, and `quarterhour` sequentially
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
#### test_api_dsl_channel_status
##### Description
Test the *dslmngr* UBUS API callback `dsl_channel_status()`, providing the method [channel status](./api/dsl.channel.md#status).
##### Test Steps
- Call `dsl_channel_status()`
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
#### test_api_dsl_channel_stats
##### Description
Test the *dslmngr* UBUS API callback `dsl_channel_stats()`, providing the method [channel stats](./api/dsl.channel.md#stats).
##### Test Steps
- Call `dsl_channel_stats()`
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
#### test_api_dsl_channel_stats_interval
##### Description
Test the *dslmngr* UBUS API callback `dsl_channel_stats()`, providing the method [channel stats](./api/dsl.channel.md#stats).
##### Test Steps
- Call `dsl_channel_stats()` with intervals `total`, `showtime`, `lastshowtime`, `currentday`, and `quarterhour` sequentially
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
#### test_api_dsl_status
##### Description
Test the *dslmngr* UBUS API callback `dsl_status_all()`, providing the method [dsl status](./api/dsl.md#status).
##### Test Steps
- Call `dsl_status_all()`
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
#### test_api_dsl_stats
##### Description
Test the *dslmngr* UBUS API callback `dsl_stats_all()`, providing the method [dsl stats](./api/dsl.md#stats).
##### Test Steps
- Call `dsl_stats_all()`
- Analyze and verify the output
##### Expected Results
Parameters' values included in the returned JSON object of the output shall be equal to those returned by the corresponding
stub API in *libdsl* building for TEST platform.
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
#### dsl_configure
##### Description
Test the *dslmngr* UBUS API callback `dsl_line_configure()`, providing the method [dsl configure](./api/dsl.line.md#configure).
##### Test Steps
- Prepare valid input parameters
- Call `dsl_line_configure()`
- Analyze and verify the output
##### Expected Results
The dumped input parameters by the corresponding libdsl API must be as same as those prepared in th first step. And the
returned value must indicate success.
#### dsl_configure_fail
##### Description
Test the *dslmngr* UBUS API callback `dsl_line_configure()`, providing the method [dsl configure](./api/dsl.line.md#configure).
##### Test Steps
- Prepare invalid input parameters
- Call `dsl_line_configure()`
- Analyze and verify the output
##### Expected Results
The dumped input parameters by the corresponding libdsl API must be as same as those prepared in th first step. And the
returned value must indicate failure.
#### atm_configure
##### Description
Test the *dslmngr* UBUS API callback `atm_link_configure()`, providing the method [atm configure](./api/atm.link.md#configure).
##### Test Steps
- Prepare valid input parameters
- Call `atm_link_configure()`
- Analyze and verify the output
##### Expected Results
The dumped input parameters by the corresponding libdsl API must be as same as those prepared in th first step. And the
returned value must indicate success.
#### atm_configure_fail
##### Description
Test the *dslmngr* UBUS API callback `atm_link_configure()`, providing the method [atm configure](./api/atm.link.md#configure).
##### Test Steps
- Prepare valid input parameters
- Call `atm_link_configure()`
- Analyze and verify the output
##### Expected Results
The dumped input parameters by the corresponding libdsl API must be as same as those prepared in th first step. And the
returned value must indicate failure.