Merge test folder of test branch
[iotivity.git] / test / src / tc / pm / gtest / csdk / src / stc / PMCsdkTest.cpp
1 /******************************************************************
2  *
3  * Copyright 2017 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  *
20  ******************************************************************/
21 #include "PMCsdkHelper.h"
22 #include "PMCsdkUtilityHelper.h"
23
24 class PMCsdkTest_stc: public ::testing::Test
25 {
26 protected:
27     OCProvisionDev_t *m_OwnList, *m_UnownList;
28     OicSecAcl_t *m_Acl, *m_Acl1, *m_Acl2;
29     PMCsdkHelper m_PMHelper;
30
31     virtual void SetUp()
32     {
33         CommonTestUtil::runCommonTCSetUpPart();
34         CommonUtil::killApp(KILL_SERVERS);
35         PMCsdkUtilityHelper::removeAllResFile();
36
37         CommonUtil::copyFile(JUSTWORKS_SERVER_CBOR_O1_OWNED_BACKUP, JUSTWORKS_SERVER_CBOR_O1);
38         CommonUtil::copyFile(JUSTWORKS_SERVER_CBOR_O2_OWNED_BACKUP, JUSTWORKS_SERVER_CBOR_O2);
39         CommonUtil::copyFile(CLIENT_CBOR_01_OWNED_BACKUP, CLIENT_CBOR_01);
40         CommonUtil::copyFile(DEVICE_PROP_CBOR_01_OWNED_BACKUP, DEVICE_PROP_CBOR_01);
41         CommonUtil::copyFile(CLIENT_DB_01_OWNED_BACKUP, CLIENT_DB_01);
42         CommonUtil::waitInSecond(DELAY_MEDIUM);
43
44         CommonUtil::launchApp(JUSTWORKS_SERVER1);
45         CommonUtil::launchApp(JUSTWORKS_SERVER2);
46         CommonUtil::waitInSecond(DELAY_LONG);
47         m_UnownList = NULL;
48         m_OwnList = NULL;
49         m_Acl = NULL;
50
51         if (!m_PMHelper.initProvisionClient(OTM_JUSTWORK, (char*) CLIENT_DB_01))
52         {
53             SET_FAILURE(m_PMHelper.getFailureMessage());
54             return;
55         }
56
57         if (!m_PMHelper.discoverOwnedDevices(DISCOVERY_TIMEOUT, &m_OwnList, OC_STACK_OK))
58         {
59             SET_FAILURE(m_PMHelper.getFailureMessage());
60             return;
61         }
62     }
63
64     virtual void TearDown()
65     {
66         CommonTestUtil::runCommonTCTearDownPart();
67         CommonUtil::killApp(KILL_SERVERS);
68     }
69 };
70
71 /**
72  * @since           2015-12-08
73  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
74  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
75  * @see             OCStackResult OCInitPM(const char* dbPath)
76  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
77  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)* @objective Test OCProvisionPairwiseDevices Negatively with Same 2 Device
78  * @objective       Test OCProvisionPairwiseDevices negatively calling it multiple time
79  * @target          OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
80  * @test_data       call OCProvisionPairwiseDevices second time
81  * @pre_condition   Start two justworks simulators
82  * @procedure       1. call OCRegisterPersistentStorageHandler
83  *                  2. call OCInit
84  *                  3. call OCInitPM
85  *                  4. call OCDiscoverUnownedDevices
86  *                  5. call OCDoOwnershipTransfer
87  *                  6. call OCDiscoverOwnedDevices
88  *                  7. call OCProvisionPairwiseDevices
89  *                  8. call OCProvisionPairwiseDevices
90  * @post_condition  None
91  * @expected        OCProvisionPairwiseDevices will return OC_STACK_INVALID_PARAM while calling for the second time.
92  */
93 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
94 TEST_F(PMCsdkTest_stc, ProvisionPairwiseDevicesMultipleTime_EG_N)
95 {
96     OCProvisionDev_t *device1 = m_OwnList;
97     OCProvisionDev_t *device2 = m_OwnList->next;
98     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
99     size_t keySize = OWNER_PSK_LENGTH_128;
100
101     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
102                     device1, NULL, device2, NULL, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
103     {
104         SET_FAILURE(m_PMHelper.getFailureMessage());
105         return;
106     }
107
108     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
109                     device1, NULL, device2, NULL, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_INVALID_PARAM))
110     {
111         SET_FAILURE(m_PMHelper.getFailureMessage());
112     }
113 }
114 #endif
115
116 /**
117  * @since           2015-02-19
118  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
119  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
120  * @see             OCStackResult OCInitPM(const char* dbPath)
121  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
122  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
123  * @objective       Test OCUnlinkDevices  negatively trying to remove client device.
124  * @target          OCStackResult OCUnlinkDevices(void* ctx, const OCProvisionDev_t* pTargetDev1, const OCProvisionDev_t* pTargetDev2, OCProvisionResultCB resultCallback)
125  * @test_data       pTargetDev1 = client device
126  * @pre_condition   Start two justworks simulators
127  * @procedure       1. call OCRegisterPersistentStorageHandler
128  *                  2. call OCInit
129  *                  3. call OCInitPM
130  *                  4. call OCDiscoverUnownedDevices
131  *                  5. call OCDoOwnershipTransfer
132  *                  6. call OCDiscoverOwnedDevices
133  *                  7. call OCUnlinkDevices
134  * @post_condition  None
135  * @expected        OCUnlinkDevices will return OC_STACK_INVALID_PARAM
136  */
137 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
138 TEST_F(PMCsdkTest_stc, UnlinkDevicesClientDev_EG_N)
139 {
140     OCProvisionDev_t *device1 = m_OwnList->next->next;
141     OCProvisionDev_t *device2 = m_OwnList;
142
143     if (!m_PMHelper.unlinkDevices((void*)ctxUnlinkDevice, device1, device2,
144                     PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_INVALID_PARAM))
145     {
146         SET_FAILURE(m_PMHelper.getFailureMessage());
147     }
148 }
149 #endif
150
151 /**
152  * @since           2015-02-19
153  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
154  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
155  * @see             OCStackResult OCInitPM(const char* dbPath)
156  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
157  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
158  * @objective       Test OCUnlinkDevices  negatively trying to unlink same device.
159  * @target          OCStackResult OCUnlinkDevices(void* ctx, const OCProvisionDev_t* pTargetDev1, const OCProvisionDev_t* pTargetDev2, OCProvisionResultCB resultCallback)
160  * @test_data       pTargetDev1 = pTargetDev2
161  * @pre_condition   Start two justworks simulators
162  * @procedure       1. call OCRegisterPersistentStorageHandler
163  *                  2. call OCInit
164  *                  3. call OCInitPM
165  *                  4. call OCDiscoverUnownedDevices
166  *                  5. call OCDoOwnershipTransfer
167  *                  6. call OCDiscoverOwnedDevices
168  *                  7. call OCUnlinkDevices
169  * @post_condition  None
170  * @expected        OCUnlinkDevices will return OC_STACK_INVALID_PARAM
171  */
172 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
173 TEST_F(PMCsdkTest_stc, UnlinkDevicesSameDevicesDev_EG_N)
174 {
175     OCProvisionDev_t *device1 = m_OwnList;
176
177     if (!m_PMHelper.unlinkDevices((void*)ctxUnlinkDevice, device1, device1,
178                     PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_INVALID_PARAM))
179     {
180         SET_FAILURE(m_PMHelper.getFailureMessage());
181     }
182 }
183 #endif
184
185 /**
186  * @since           2016-02-19
187  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
188  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
189  * @see             OCStackResult OCInitPM(const char* dbPath)
190  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
191  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
192  * @see             OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
193  * @objective       Test OCGetLinkedStatus positively with  unformatted uuidOfDevice
194  * @target          OCStackResult OCGetLinkedStatus(const OicUuid_t* uuidOfDevice, OCUuidList_t** uuidList, size_t* numOfDevices)
195  * @test_data       OCGetLinkedStatus with a reference of unformatted Device ID
196  * @pre_condition   Start two justworks simulators
197  * @procedure       1. call OCRegisterPersistentStorageHandler
198  *                  2. call OCInit
199  *                  3. call OCInitPM
200  *                  4. call OCDiscoverUnownedDevices
201  *                  5. call OCDoOwnershipTransfer
202  *                  6. call OCDiscoverOwnedDevices
203  *                  7. call OCProvisionPairwiseDevices
204  *                  8. call OCGetLinkedStatus
205  *                  9. call OCDeleteACLList for m_Acl1
206  *                 10. call OCDeleteACLList for m_Acl2
207  * @post_condition  None
208  * @expected        OCGetLinkedStatus will return OC_STACK_INVALID_PARAM
209  */
210 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
211 TEST_F(PMCsdkTest_stc, OCGetLinkedStatusUuid_URSV_N)
212 {
213     OCProvisionDev_t *device1 = m_OwnList;
214     OCProvisionDev_t *device2 = m_OwnList->next;
215     m_Acl1 = createAcl(DEVICE_INDEX_ONE, FULL_PERMISSION, &m_OwnList);
216     m_Acl2 = createAcl(DEVICE_INDEX_TWO, FULL_PERMISSION, &m_OwnList);
217     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
218     size_t keySize = OWNER_PSK_LENGTH_128;
219
220     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
221                     device1, m_Acl1, device2, m_Acl2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
222     {
223         SET_FAILURE(m_PMHelper.getFailureMessage());
224         return;
225     }
226
227     OicUuid_t uuidOfDevice;
228
229     for(int i=0; i <= 15; i++)
230     {
231         uuidOfDevice.id[i]= 1;
232     }
233
234     OCUuidList_t* uuidList = NULL;
235     size_t numOfDevices;
236
237     if (!m_PMHelper.getLinkedStatus(&uuidOfDevice, &uuidList, &numOfDevices, OC_STACK_INVALID_PARAM))
238     {
239         SET_FAILURE(m_PMHelper.getFailureMessage());
240     }
241
242     if (!m_PMHelper.deleteACLList(m_Acl1))
243     {
244         SET_FAILURE(m_PMHelper.getFailureMessage());
245     }
246
247     if (!m_PMHelper.deleteACLList(m_Acl2))
248     {
249         SET_FAILURE(m_PMHelper.getFailureMessage());
250     }
251 }
252 #endif
253
254 /**
255  * @since           2016-07-25
256  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
257  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
258  * @see             OCStackResult OCInitPM(const char* dbPath)
259  * @objective       Test OCDoOwnershipTransfer negatively calling the API multiple times.
260  * @target          OCDoOwnershipTransfer(void* ctx,OCProvisionDev_t *targetDevices,OCProvisionResultCB resultCallback)
261  * @test_data       OIC_JUSTWORKS ownership transfer
262  * @pre_condition   Start two justworks simulators
263  * @procedure       1. call OCRegisterPersistentStorageHandler
264  *                  2. call OCInit
265  *                  3. call OCInitPM
266  *                  4. call OCDiscoverUnownedDevices
267  *                  5. call OCDoOwnershipTransfer
268  *                  6. call OCDoOwnershipTransfer
269  * @post_condition  None
270  * @expected        OCDoOwnershipTransfer will return OC_STACK_ERROR while calling it second time
271  */
272 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
273 TEST_F(PMCsdkTest_stc, OCDoOwnershipTransferJustWorksMultipleTimes_EG_N)
274 {
275     CommonUtil::killApp(KILL_SERVERS);
276     PMCsdkUtilityHelper::removeAllResFile();
277     CommonUtil::copyFile(JUSTWORKS_SERVER_CBOR_O1_UNOWNED_BACKUP, JUSTWORKS_SERVER_CBOR_O1);
278     CommonUtil::copyFile(JUSTWORKS_SERVER_CBOR_O2_UNOWNED_BACKUP, JUSTWORKS_SERVER_CBOR_O2);
279     CommonUtil::copyFile(RANDOMPIN_SERVER_CBOR_01_UNOWNED_BACKUP, RANDOMPIN_SERVER_CBOR_01);
280     CommonUtil::copyFile(CLIENT_CBOR_01_UNOWNED_BACKUP, CLIENT_CBOR_01);
281     CommonUtil::waitInSecond(DELAY_MEDIUM);
282
283     CommonUtil::launchApp(JUSTWORKS_SERVER1);
284     CommonUtil::launchApp(JUSTWORKS_SERVER2);
285     CommonUtil::waitInSecond(DELAY_LONG);
286     m_UnownList = NULL;
287     m_OwnList = NULL;
288     m_Acl = NULL;
289
290     if (!m_PMHelper.initProvisionClient(OTM_JUSTWORK))
291     {
292         SET_FAILURE(m_PMHelper.getFailureMessage());
293         return;
294     }
295
296     if (!m_PMHelper.discoverUnownedDevices(DISCOVERY_TIMEOUT,
297                     &m_UnownList, OC_STACK_OK))
298     {
299         SET_FAILURE(m_PMHelper.getFailureMessage());
300         return;
301     }
302
303     if (!m_PMHelper.doOwnerShipTransfer((void*)g_ctx, &m_UnownList,
304                     PMCsdkHelper::ownershipTransferCB, OC_STACK_OK))
305     {
306         SET_FAILURE(m_PMHelper.getFailureMessage());
307         return;
308     }
309
310     if (!m_PMHelper.discoverOwnedDevices(DISCOVERY_TIMEOUT, &m_OwnList, OC_STACK_OK))
311     {
312         SET_FAILURE(m_PMHelper.getFailureMessage());
313         return;
314     }
315
316     if (!m_PMHelper.doOwnerShipTransfer((void*)g_ctx, &m_UnownList,
317                     PMCsdkHelper::ownershipTransferCB, OC_STACK_ERROR, false))
318     {
319         SET_FAILURE(m_PMHelper.getFailureMessage());
320     }
321 }
322 #endif
323
324 /**
325  * @since           2015-12-08
326  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
327  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
328  * @see             OCStackResult OCInitPM(const char* dbPath)
329  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
330  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)* @objective Test OCProvisionPairwiseDevices Negatively with Same 2 Device
331  * @objective       Test OCProvisionPairwiseDevices negatively with pDev1 = pDev2
332  * @target          OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
333  * @test_data       pDev1 = pDev2
334  * @pre_condition   Start two justworks simulators
335  * @procedure       1. call OCRegisterPersistentStorageHandler
336  *                  2. call OCInit
337  *                  3. call OCInitPM
338  *                  4. call OCDiscoverUnownedDevices
339  *                  5. call OCDoOwnershipTransfer
340  *                  6. call OCDiscoverOwnedDevices
341  *                  7. call OCProvisionPairwiseDevices
342  * @post_condition  None
343  * @expected        OCProvisionPairwiseDevices will return OC_STACK_INVALID_PARAM
344  */
345 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
346 TEST_F(PMCsdkTest_stc, ProvisionPairwiseDevicesSameDevices_EG_N)
347 {
348     OCProvisionDev_t *device2 = m_OwnList->next;
349     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
350     size_t keySize = OWNER_PSK_LENGTH_128;
351
352     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
353                     device2, NULL, device2, NULL, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_INVALID_PARAM))
354     {
355         SET_FAILURE(m_PMHelper.getFailureMessage());
356     }
357 }
358 #endif
359
360 /**
361  * @since           2015-02-23
362  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
363  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
364  * @see             OCStackResult OCInitPM(const char* dbPath)
365  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
366  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
367  * @objective       Test OCProvisionCredentials negatively calling it multiple times.
368  * @target          OCStackResult OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, const OCProvisionDev_t *pDev2, OCProvisionResultCB resultCallback)
369  * @test_data       Regular data OCProvisionCredentials
370  * @pre_condition   Start two justworks simulators
371  * @procedure       1. call OCRegisterPersistentStorageHandler
372  *                  2. call OCInit
373  *                  3. call OCInitPM
374  *                  4. call OCDiscoverUnownedDevices
375  *                  5. call OCDoOwnershipTransfer
376  *                  6. call OCDiscoverOwnedDevices
377  *                  7. call OCProvisionCredentials
378  *                  8. call OCProvisionCredentials
379  * @post_condition  None
380  * @expected        OCProvisionCredentials will return OC_STACK_INVALID_PARAM while calling it second time
381  */
382 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
383 TEST_F(PMCsdkTest_stc, ProvisionCredentialMultipleTimes_EG_N)
384 {
385     OCProvisionDev_t *device1 = m_OwnList;
386     OCProvisionDev_t *device2 = m_OwnList->next;
387     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
388     size_t keySize = OWNER_PSK_LENGTH_128;
389
390     if (!m_PMHelper.provisionCredentials((void*)ctxProvCreadential, type, keySize, device1,
391                     device2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
392     {
393         SET_FAILURE(m_PMHelper.getFailureMessage());
394         return;
395     }
396
397     if (!m_PMHelper.provisionCredentials((void*)ctxProvCreadential, type, keySize, device1,
398                     device2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_INVALID_PARAM))
399     {
400         SET_FAILURE(m_PMHelper.getFailureMessage());
401     }
402 }
403 #endif
404
405 /**
406  * @since           2015-02-19
407  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
408  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
409  * @see             OCStackResult OCInitPM(const char* dbPath)
410  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
411  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
412  * @see             OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
413  * @objective       Test OCUnlinkDevices  negatively calling the API multiple times.
414  * @target          OCStackResult OCUnlinkDevices(void* ctx, const OCProvisionDev_t* pTargetDev1, const OCProvisionDev_t* pTargetDev2, OCProvisionResultCB resultCallback)
415  * @test_data       Regular data for OCUnlinkDevices
416  * @pre_condition   Start two justworks simulators
417  * @procedure       1. call OCRegisterPersistentStorageHandler
418  *                  2. call OCInit
419  *                  3. call OCInitPM
420  *                  4. call OCDiscoverUnownedDevices
421  *                  5. call OCDoOwnershipTransfer
422  *                  6. call OCDiscoverOwnedDevices
423  *                  7. call OCProvisionPairwiseDevices
424  *                  8. call OCUnlinkDevices
425  *                  9. call OCUnlinkDevices
426  *                 10. call OCDeleteACLList for m_Acl1
427  *                 11. call OCDeleteACLList for m_Acl2
428  * @post_condition  None
429  * @expected        OCUnlinkDevices will return OC_STACK_INVALID_PARAM while calling it second time
430  */
431 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
432 TEST_F(PMCsdkTest_stc, UnlinkDevicesMultipleTimes_EG_N)
433 {
434     OCProvisionDev_t *device1 = m_OwnList;
435     OCProvisionDev_t *device2 = m_OwnList->next;
436     m_Acl1 = createAcl(DEVICE_INDEX_ONE, FULL_PERMISSION, &m_OwnList);
437     m_Acl2 = createAcl(DEVICE_INDEX_TWO, FULL_PERMISSION, &m_OwnList);
438     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
439     size_t keySize = OWNER_PSK_LENGTH_128;
440
441     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
442                     device1, m_Acl1, device2, m_Acl2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
443     {
444         SET_FAILURE(m_PMHelper.getFailureMessage());
445         return;
446     }
447
448     if (!m_PMHelper.unlinkDevices((void*)ctxUnlinkDevice, device1, device2,
449                     PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_OK))
450     {
451         SET_FAILURE(m_PMHelper.getFailureMessage());
452         return;
453     }
454
455     if (!m_PMHelper.unlinkDevices((void*)ctxUnlinkDevice, device1, device2,
456                     PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_INVALID_PARAM))
457     {
458         SET_FAILURE(m_PMHelper.getFailureMessage());
459     }
460
461     if (!m_PMHelper.deleteACLList(m_Acl1))
462     {
463         SET_FAILURE(m_PMHelper.getFailureMessage());
464     }
465
466     if (!m_PMHelper.deleteACLList(m_Acl2))
467     {
468         SET_FAILURE(m_PMHelper.getFailureMessage());
469     }
470 }
471 #endif
472
473 /**
474  * @since           2016-02-22
475  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
476  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
477  * @see             OCStackResult OCInitPM(const char* dbPath)
478  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
479  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
480  * @see             OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
481  * @objective       Test OCRemoveDevice negatively calling the API multiple times.
482  * @target          OCStackResult OCRemoveDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery, const OCProvisionDev_t* pTargetDev, OCProvisionResultCB resultCallback)
483  * @test_data       waitTimeForOwnedDeviceDiscovery = DISCOVERY_TIMEOUT_ONE
484  * @pre_condition   Start two justworks simulators
485  * @procedure       1. call OCRegisterPersistentStorageHandler
486  *                  2. call OCInit
487  *                  3. call OCInitPM
488  *                  4. call OCDiscoverUnownedDevices
489  *                  5. call OCDoOwnershipTransfer
490  *                  6. call OCDiscoverOwnedDevices
491  *                  7. call OCProvisionPairwiseDevices
492  *                  8. call OCRemoveDevice
493  *                  9. call OCRemoveDevice
494  *                 10. call OCDeleteACLList for m_Acl1
495  *                 11. call OCDeleteACLList for m_Acl2
496  * @post_condition  None
497  * @expected        OCRemoveDevice will return OC_STACK_INVALID_PARAM while calling it second time
498  */
499 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
500 TEST_F(PMCsdkTest_stc, RemoveDeviceTimeMultipleTimes_EG_N)
501 {
502     OCProvisionDev_t *device1 = m_OwnList;
503     OCProvisionDev_t *device2 = m_OwnList->next;
504     m_Acl1 = createAcl(DEVICE_INDEX_ONE, FULL_PERMISSION, &m_OwnList);
505     m_Acl2 = createAcl(DEVICE_INDEX_TWO, FULL_PERMISSION, &m_OwnList);
506     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
507     size_t keySize = OWNER_PSK_LENGTH_128;
508
509     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
510                     device1, m_Acl1, device2, m_Acl2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
511     {
512         SET_FAILURE(m_PMHelper.getFailureMessage());
513         return;
514     }
515
516     if (!m_PMHelper.removeDevice((void*)ctxRemoveDevice, DISCOVERY_TIMEOUT_ONE, device1,
517                     PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_OK))
518     {
519         SET_FAILURE(m_PMHelper.getFailureMessage());
520         return;
521     }
522
523     if (!m_PMHelper.removeDevice((void*)ctxRemoveDevice, DISCOVERY_TIMEOUT_ONE, device1,
524                     PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_INVALID_PARAM))
525     {
526         SET_FAILURE(m_PMHelper.getFailureMessage());
527     }
528
529     if (!m_PMHelper.deleteACLList(m_Acl1))
530     {
531         SET_FAILURE(m_PMHelper.getFailureMessage());
532     }
533
534     if (!m_PMHelper.deleteACLList(m_Acl2))
535     {
536         SET_FAILURE(m_PMHelper.getFailureMessage());
537     }
538 }
539 #endif
540
541 /**
542  * @since           2016-02-19
543  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
544  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
545  * @see             OCStackResult OCInitPM(const char* dbPath)
546  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
547  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
548  * @see             OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
549  * @see             OCStackResult OCUnlinkDevices(void* ctx, const OCProvisionDev_t* pTargetDev1, const OCProvisionDev_t* pTargetDev2, OCProvisionResultCB resultCallback)
550  * @see             OCStackResult OCGetLinkedStatus(const OicUuid_t* uuidOfDevice, OCUuidList_t** uuidList, size_t* numOfDevices)
551  * @objective       Test OCUnlinkDevices positively verifying it with OCGetLinkedStatus.
552  * @target          OCStackResult OCUnlinkDevices(void* ctx, const OCProvisionDev_t* pTargetDev1, const OCProvisionDev_t* pTargetDev2, OCProvisionResultCB resultCallback)
553  * @test_data       Regular Data for OCGetLinkedStatus
554  * @pre_condition   Start two justworks simulators
555  * @procedure       1. call OCRegisterPersistentStorageHandler
556  *                  2. call OCInit
557  *                  3. call OCInitPM
558  *                  4. call OCDiscoverUnownedDevices
559  *                  5. call OCDoOwnershipTransfer
560  *                  6. call OCDiscoverOwnedDevices
561  *                  7. call OCProvisionPairwiseDevices
562  *                  8. call OCGetLinkedStatus
563  *                  9. call OCUnlinkDevices
564  *                 10. call OCGetLinkedStatus
565  *                 11. call OCDeleteACLList for m_Acl1
566  *                 12. call OCDeleteACLList for m_Acl2
567  * @post_condition  None
568  * @expected        numOfDevices provided by OCGetLinkedStatus will be different
569  */
570 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
571 TEST_F(PMCsdkTest_stc, OCGetLinkedStatusBeforenAfterUnlinkDev_RSV_SRC_P)
572 {
573     OCProvisionDev_t *device1 = m_OwnList;
574     OCProvisionDev_t *device2 = m_OwnList->next;
575     m_Acl1 = createAcl(DEVICE_INDEX_ONE, FULL_PERMISSION, &m_OwnList);
576     m_Acl2 = createAcl(DEVICE_INDEX_TWO, FULL_PERMISSION, &m_OwnList);
577     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
578     size_t keySize = OWNER_PSK_LENGTH_128;
579
580     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
581                     device1, m_Acl1, device2, m_Acl2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
582     {
583         SET_FAILURE(m_PMHelper.getFailureMessage());
584         return;
585     }
586
587     OCUuidList_t* uuidList = NULL;
588     size_t numOfDevices = 0;
589
590     if (!m_PMHelper.getLinkedStatus(&device1->doxm->deviceID, &uuidList, &numOfDevices, OC_STACK_OK))
591     {
592         SET_FAILURE(m_PMHelper.getFailureMessage());
593         return;
594     }
595
596     if(0 == numOfDevices)
597     {
598         SET_FAILURE("No Device has been linked.");
599         return;
600     }
601
602     size_t tempNumOfDevices = numOfDevices;
603
604     if (!m_PMHelper.unlinkDevices((void*)ctxUnlinkDevice, device1, device2,
605                     NULL, OC_STACK_INVALID_CALLBACK))
606     {
607         SET_FAILURE(m_PMHelper.getFailureMessage());
608         return;
609     }
610
611     uuidList = NULL;
612     numOfDevices = 0;
613
614     if (!m_PMHelper.getLinkedStatus(&device1->doxm->deviceID, &uuidList, &numOfDevices, OC_STACK_OK))
615     {
616         SET_FAILURE(m_PMHelper.getFailureMessage());
617         return;
618     }
619
620     if(tempNumOfDevices > numOfDevices)
621     {
622         SET_FAILURE("No Device has been unlinked.");
623     }
624
625     if (!m_PMHelper.deleteACLList(m_Acl1))
626     {
627         SET_FAILURE(m_PMHelper.getFailureMessage());
628     }
629
630     if (!m_PMHelper.deleteACLList(m_Acl2))
631     {
632         SET_FAILURE(m_PMHelper.getFailureMessage());
633     }
634 }
635 #endif
636
637 /**
638  * @since           2016-07-27
639  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
640  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
641  * @see             OCStackResult OCInitPM(const char* dbPath)
642  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
643  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
644  * @objective       Test OCProvisionACL positively with no permission
645  * @target          OCStackResult OCProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl, OCProvisionResultCB resultCallback)
646  * @test_data       ACL Permission CRUDN = No Permission
647  * @pre_condition   Start two justworks simulators
648  * @procedure       1. call OCRegisterPersistentStorageHandler
649  *                  2. call OCInit
650  *                  3. call OCInitPM
651  *                  4. call OCDiscoverUnownedDevices
652  *                  5. call OCDoOwnershipTransfer
653  *                  6. call OCDiscoverOwnedDevices
654  *                  7. call OCProvisionACL
655  *                  8. call OCDeleteACLList for m_Acl
656  * @post_condition  None
657  * @expected        OCProvisionACL will return OC_STACK_OK
658  */
659 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
660 TEST_F(PMCsdkTest_stc, ProvisionAclPermission_LBV_P)
661 {
662     m_Acl = createAcl(DEVICE_INDEX_ONE, NO_PERMISSION, &m_OwnList);
663
664     if (!m_PMHelper.provisionACL((void*)g_ctx, m_OwnList, m_Acl,
665                     PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
666     {
667         SET_FAILURE(m_PMHelper.getFailureMessage());
668     }
669
670     if (!m_PMHelper.deleteACLList(m_Acl))
671     {
672         SET_FAILURE(m_PMHelper.getFailureMessage());
673     }
674 }
675 #endif
676
677 /**
678  * @since           2016-07-27
679  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
680  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
681  * @see             OCStackResult OCInitPM(const char* dbPath)
682  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
683  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
684  * @objective       Test OCProvisionACL positively with no permission
685  * @target          OCStackResult OCProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecAcl_t *acl, OCProvisionResultCB resultCallback)
686  * @test_data       ACL Permission CRUDN = 65535
687  * @pre_condition   Start two justworks simulators
688  * @procedure       1. call OCRegisterPersistentStorageHandler
689  *                  2. call OCInit
690  *                  3. call OCInitPM
691  *                  4. call OCDiscoverUnownedDevices
692  *                  5. call OCDoOwnershipTransfer
693  *                  6. call OCDiscoverOwnedDevices
694  *                  7. call OCProvisionACL
695  *                  8. call OCDeleteACLList for m_Acl
696  * @post_condition  None
697  * @expected        OCProvisionACL will return OC_STACK_OK
698  */
699 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
700 TEST_F(PMCsdkTest_stc, ProvisionAclPermission_UBV_P)
701 {
702     m_Acl = createAcl(DEVICE_INDEX_ONE, MAX_PERMISSION_RANGE, &m_OwnList);
703
704     if (!m_PMHelper.provisionACL((void*)g_ctx, m_OwnList, m_Acl,
705                     PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
706     {
707         SET_FAILURE(m_PMHelper.getFailureMessage());
708     }
709
710     if (!m_PMHelper.deleteACLList(m_Acl))
711     {
712         SET_FAILURE(m_PMHelper.getFailureMessage());
713     }
714 }
715 #endif
716
717 /**
718  * @since           2017-01-24
719  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
720  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
721  * @see             OCStackResult OCInitPM(const char* dbPath)
722  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
723  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
724  * @see             OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
725  * @objective       Test OCRemoveDeviceWithUuid negatively calling the API multiple times.
726  * @target          OCStackResult OCRemoveDeviceWithUuid(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery, const OicUuid_t* pTargetUuid, OCProvisionResultCB resultCallback)
727  * @test_data       waitTimeForOwnedDeviceDiscovery = DISCOVERY_TIMEOUT_ONE
728  * @pre_condition   Start two justworks simulators
729  * @procedure       1. call OCRegisterPersistentStorageHandler
730  *                  2. call OCInit
731  *                  3. call OCInitPM
732  *                  4. call OCDiscoverUnownedDevices
733  *                  5. call OCDoOwnershipTransfer
734  *                  6. call OCDiscoverOwnedDevices
735  *                  7. call OCProvisionPairwiseDevices
736  *                  8. call OCRemoveDeviceWithUuid
737  *                  9. call OCRemoveDeviceWithUuid
738  *                 10. call OCDeleteACLList for m_Acl1
739  *                 11. call OCDeleteACLList for m_Acl2
740  * @post_condition  None
741  * @expected        OCRemoveDeviceWithUuid will return OC_STACK_INVALID_PARAM while calling it second time
742  */
743 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
744 TEST_F(PMCsdkTest_stc, RemoveDeviceWithUuidMultipleTimes_EG_N)
745 {
746     OCProvisionDev_t *device1 = m_OwnList;
747     OCProvisionDev_t *device2 = m_OwnList->next;
748     m_Acl1 = createAcl(DEVICE_INDEX_ONE, FULL_PERMISSION, &m_OwnList);
749     m_Acl2 = createAcl(DEVICE_INDEX_TWO, FULL_PERMISSION, &m_OwnList);
750     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
751     size_t keySize = OWNER_PSK_LENGTH_128;
752
753     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
754                     device1, m_Acl1, device2, m_Acl2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
755     {
756         SET_FAILURE(m_PMHelper.getFailureMessage());
757         return;
758     }
759
760     OicUuid_t deviceUuid = device1->doxm->deviceID;
761
762     if (!m_PMHelper.removeDeviceWithUuid((void*)ctxRemoveDeviceWithUuid, DISCOVERY_TIMEOUT_ONE, &deviceUuid, PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_OK))
763     {
764         SET_FAILURE(m_PMHelper.getFailureMessage());
765     }
766
767     if (!m_PMHelper.removeDeviceWithUuid((void*)ctxRemoveDeviceWithUuid, DISCOVERY_TIMEOUT_ONE, &deviceUuid, PMCsdkCallbackHelper::provisionDeleteCB, OC_STACK_INVALID_PARAM))
768     {
769         SET_FAILURE(m_PMHelper.getFailureMessage());
770     }
771
772     if (!m_PMHelper.deleteACLList(m_Acl1))
773     {
774         SET_FAILURE(m_PMHelper.getFailureMessage());
775     }
776
777     if (!m_PMHelper.deleteACLList(m_Acl2))
778     {
779         SET_FAILURE(m_PMHelper.getFailureMessage());
780     }
781 }
782 #endif
783
784 /**
785  * @since           2017-01-25
786  * @see             OCStackResult OCRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler)
787  * @see             OCStackResult OCInit(const char *ipAddr, uint16_t port, OCMode mode)
788  * @see             OCStackResult OCInitPM(const char* dbPath)
789  * @see             OCStackResult OCDoOwnershipTransfer(void* ctx, OCProvisionDev_t *targetDevices, OCProvisionResultCB resultCallback)
790  * @see             OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList)
791  * @see             OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_t keySize, const OCProvisionDev_t *pDev1, OicSecAcl_t *pDev1Acl, const OCProvisionDev_t *pDev2, OicSecAcl_t *pDev2Acl, OCProvisionResultCB resultCallback)
792  * @objective       Test OCResetDevice negatively calling the API multiple times.
793  * @target          OCStackResult OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDiscovery, const OCProvisionDev_t* pTargetDev, OCProvisionResultCB resultCallback)
794  * @test_data       waitTimeForOwnedDeviceDiscovery = DISCOVERY_TIMEOUT_ONE
795  * @pre_condition   Start two justworks simulators
796  * @procedure       1. call OCRegisterPersistentStorageHandler
797  *                  2. call OCInit
798  *                  3. call OCInitPM
799  *                  4. call OCDiscoverUnownedDevices
800  *                  5. call OCDoOwnershipTransfer
801  *                  6. call OCDiscoverOwnedDevices
802  *                  7. call OCProvisionPairwiseDevices
803  *                  8. call OCResetDevice
804  *                  9. call OCResetDevice
805  *                 10. call OCDeleteACLList for m_Acl1
806  *                 11. call OCDeleteACLList for m_Acl2
807  * @post_condition  None
808  * @expected        OCResetDevice will return OC_STACK_OK while calling it second time
809  */
810 #if defined(__LINUX__) || defined(__TIZEN__) || defined(__WINDOWS__)
811 TEST_F(PMCsdkTest_stc, ResetDeviceMutipleTimes_SRC_P)
812 {
813     OCProvisionDev_t *device1 = m_OwnList;
814     OCProvisionDev_t *device2 = m_OwnList->next;
815     m_Acl1 = createAcl(DEVICE_INDEX_ONE, FULL_PERMISSION, &m_OwnList);
816     m_Acl2 = createAcl(DEVICE_INDEX_TWO, FULL_PERMISSION, &m_OwnList);
817     OicSecCredType_t type = SYMMETRIC_PAIR_WISE_KEY;
818     size_t keySize = OWNER_PSK_LENGTH_128;
819
820     if (!m_PMHelper.provisionPairwiseDevices((void*)ctxProvPairwise, type, keySize,
821                     device1, m_Acl1, device2, m_Acl2, PMCsdkCallbackHelper::provisionPostCB, OC_STACK_OK))
822     {
823         SET_FAILURE(m_PMHelper.getFailureMessage());
824         return;
825     }
826
827     if (!m_PMHelper.resetDevice((void*)ctxResetDevice, DISCOVERY_TIMEOUT, device1,
828                     PMCsdkHelper::syncDeviceCB, OC_STACK_OK))
829     {
830         SET_FAILURE(m_PMHelper.getFailureMessage());
831         return;
832     }
833
834     if (!m_PMHelper.resetDevice((void*)ctxResetDevice, DISCOVERY_TIMEOUT, device1,
835                     PMCsdkHelper::syncDeviceCB, OC_STACK_OK))
836     {
837         SET_FAILURE(m_PMHelper.getFailureMessage());
838     }
839
840     if (!m_PMHelper.deleteACLList(m_Acl1))
841     {
842         SET_FAILURE(m_PMHelper.getFailureMessage());
843     }
844
845     if (!m_PMHelper.deleteACLList(m_Acl2))
846     {
847         SET_FAILURE(m_PMHelper.getFailureMessage());
848     }
849 }
850 #endif