1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef OMIT_MULTI_VER
16 #include <gtest/gtest.h>
17 
18 #include "distributeddb_data_generate_unit_test.h"
19 #include "distributeddb_interfaces_transaction_testcase.h"
20 #include "distributeddb_tools_unit_test.h"
21 
22 using namespace testing::ext;
23 using namespace DistributedDB;
24 using namespace DistributedDBUnitTest;
25 using namespace std;
26 
27 namespace {
28     string g_testDir;
29     const bool LOCAL_ONLY = false;
30     const string STORE_ID = STORE_ID_SYNC;
31 
32     KvStoreDelegateManager g_mgr(APP_ID, USER_ID);
33     KvStoreConfig g_config;
34 
35     // define the g_kvDelegateCallback, used to get some information when open a kv store.
36     DBStatus g_kvDelegateStatus = INVALID_ARGS;
37     KvStoreDelegate *g_kvDelegatePtr = nullptr;
38     // the type of g_kvDelegateCallback is function<void(DBStatus, KvStoreDelegate*)>
39     auto g_kvDelegateCallback = bind(&DistributedDBToolsUnitTest::KvStoreDelegateCallback, placeholders::_1,
40         placeholders::_2, std::ref(g_kvDelegateStatus), std::ref(g_kvDelegatePtr));
41 
42     // define the g_snapshotDelegateCallback, used to get some information when open a kv snapshot.
43     DBStatus g_snapshotDelegateStatus = INVALID_ARGS;
44     KvStoreSnapshotDelegate *g_snapshotDelegatePtr = nullptr;
45     // the type of g_snapshotDelegateCallback is function<void(DBStatus, KvStoreSnapshotDelegate*)>
46     auto g_snapshotDelegateCallback = bind(&DistributedDBToolsUnitTest::SnapshotDelegateCallback,
47         placeholders::_1, placeholders::_2, std::ref(g_snapshotDelegateStatus), std::ref(g_snapshotDelegatePtr));
48 }
49 
50 class DistributedDBInterfacesTransactionSyncDBTest : public testing::Test {
51 public:
52     static void SetUpTestCase(void);
53     static void TearDownTestCase(void);
54     void SetUp();
55     void TearDown();
56 };
57 
SetUpTestCase(void)58 void DistributedDBInterfacesTransactionSyncDBTest::SetUpTestCase(void)
59 {
60     DistributedDBToolsUnitTest::TestDirInit(g_testDir);
61     g_config.dataDir = g_testDir;
62     g_mgr.SetKvStoreConfig(g_config);
63 }
64 
TearDownTestCase(void)65 void DistributedDBInterfacesTransactionSyncDBTest::TearDownTestCase(void)
66 {
67     if (DistributedDBToolsUnitTest::RemoveTestDbFiles(g_testDir) != 0) {
68         LOGE("rm test db files error!");
69     }
70 }
71 
SetUp(void)72 void DistributedDBInterfacesTransactionSyncDBTest::SetUp(void)
73 {
74     DistributedDBToolsUnitTest::PrintTestCaseInfo();
75     /*
76      * Here, we create STORE_ID before test,
77      * and it will be closed in TearDown().
78      */
79     KvStoreDelegate::Option option = {true, LOCAL_ONLY};
80     g_mgr.GetKvStore(STORE_ID, option, g_kvDelegateCallback);
81     EXPECT_TRUE(g_kvDelegateStatus == OK);
82     ASSERT_TRUE(g_kvDelegatePtr != nullptr);
83 }
84 
TearDown(void)85 void DistributedDBInterfacesTransactionSyncDBTest::TearDown(void)
86 {
87     if (g_kvDelegatePtr != nullptr && g_snapshotDelegatePtr != nullptr) {
88         EXPECT_TRUE(g_kvDelegatePtr->ReleaseKvStoreSnapshot(g_snapshotDelegatePtr) == OK);
89         g_snapshotDelegatePtr = nullptr;
90     }
91 
92     if (g_kvDelegatePtr != nullptr) {
93         EXPECT_EQ(g_mgr.CloseKvStore(g_kvDelegatePtr), OK);
94         g_kvDelegatePtr = nullptr;
95         EXPECT_EQ(g_mgr.DeleteKvStore(STORE_ID), OK);
96     }
97 }
98 
99 /**
100   * @tc.name: StartTransaction001
101   * @tc.desc: Test that can't call StartTransaction interface repeatedly.
102   * @tc.type: FUNC
103   * @tc.require: AR000BVRNK AR000CQDTO
104   * @tc.author: huangnaigu
105   */
106 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, StartTransaction001, TestSize.Level1)
107 {
108     /**
109      * @tc.steps:step1. call StartTransaction interface the 1st time.
110      * @tc.expected: step1. call succeed.
111      */
112     /**
113      * @tc.steps:step2. call StartTransaction interface the 2nd time.
114      * @tc.expected: step2. call failed and return ERROR.
115      */
116     DistributedDBInterfacesTransactionTestCase::StartTransaction001(g_kvDelegatePtr);
117 }
118 
119 /**
120   * @tc.name: StartTransaction002
121   * @tc.desc: Test that call StartTransaction and commit interface normally.
122   * @tc.type: FUNC
123   * @tc.require: AR000BVRNK AR000CQDTO
124   * @tc.author: huangnaigu
125   */
126 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, StartTransaction002, TestSize.Level1)
127 {
128     /**
129      * @tc.steps:step1. call StartTransaction interface.
130      * @tc.expected: step1. call succeed.
131      */
132     /**
133      * @tc.steps:step2. call commit interface.
134      * @tc.expected: step2. call succeed.
135      */
136     DistributedDBInterfacesTransactionTestCase::StartTransaction002(g_kvDelegatePtr);
137 }
138 
139 /**
140   * @tc.name: StartTransaction003
141   * @tc.desc: Test that call StartTransaction and rolback interface normally.
142   * @tc.type: FUNC
143   * @tc.require: AR000BVRNK AR000CQDTO
144   * @tc.author: huangnaigu
145   */
146 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, StartTransaction003, TestSize.Level1)
147 {
148     /**
149      * @tc.steps:step1. call StartTransaction interface.
150      * @tc.expected: step1. call succeed.
151      */
152     /**
153      * @tc.steps:step2. call rollback interface.
154      * @tc.expected: step2. call succeed.
155      */
156     DistributedDBInterfacesTransactionTestCase::StartTransaction003(g_kvDelegatePtr);
157 }
158 
159 /**
160   * @tc.name: StartTransaction004
161   * @tc.desc: Test that call StartTransaction and rolback interface normally.
162   * @tc.type: FUNC
163   * @tc.require: AR000BVRNK AR000CQDTO
164   * @tc.author: huangnaigu
165   */
166 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, StartTransaction004, TestSize.Level1)
167 {
168     /**
169      * @tc.steps:step1. call StartTransaction interface.
170      * @tc.expected: step1. call succeed.
171      */
172     /**
173      * @tc.steps:step2. put (k1, v1) to data base.
174      * @tc.expected: step2. put succeed.
175      */
176     /**
177      * @tc.steps:step3. close data base.
178      * @tc.expected: step3. close succeed.
179      */
180     /**
181      * @tc.steps:step4. use GetKvStore interface to open db.
182      * @tc.expected: step4. open succeed.
183      */
184     /**
185      * @tc.steps:step5. use snapshot interface to check the value of k1.
186      * @tc.expected: step5. can't get the record of k1.
187      */
188     DistributedDBInterfacesTransactionTestCase::StartTransaction004(g_kvDelegatePtr, STORE_ID, LOCAL_ONLY,
189         g_mgr, g_snapshotDelegatePtr);
190 }
191 
192 /**
193   * @tc.name: Commit001
194   * @tc.desc: Test that can't commit Transaction before it start.
195   * @tc.type: FUNC
196   * @tc.require: AR000BVRNK AR000CQDTO
197   * @tc.author: huangnaigu
198   */
199 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit001, TestSize.Level1)
200 {
201     /**
202      * @tc.steps:step1. commit Transaction without start it.
203      * @tc.expected: step1. commit failed and returned ERROR.
204      */
205     DistributedDBInterfacesTransactionTestCase::Commit001(g_kvDelegatePtr);
206 }
207 
208 /**
209   * @tc.name: Commit002
210   * @tc.desc: Test that can't commit Transaction repeatedly even if it start normally.
211   * @tc.type: FUNC
212   * @tc.require: AR000BVRNK AR000CQDTO
213   * @tc.author: huangnaigu
214   */
215 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit002, TestSize.Level1)
216 {
217     /**
218      * @tc.steps:step1. call StartTransaction interface.
219      * @tc.expected: step1. call succeed.
220      */
221     /**
222      * @tc.steps:step2. call commit interface the 1st time.
223      * @tc.expected: step2. call succeed.
224      */
225     /**
226      * @tc.steps:step3. call commit interface the 2nd time.
227      * @tc.expected: step3. call failed and returned ERROR.
228      */
229     DistributedDBInterfacesTransactionTestCase::Commit002(g_kvDelegatePtr);
230 }
231 
232 /**
233   * @tc.name: Commit003
234   * @tc.desc: Test that can commit Transaction after put record.
235   * @tc.type: FUNC
236   * @tc.require: AR000BVRNK AR000CQDTO
237   * @tc.author: huangnaigu
238   */
239 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit003, TestSize.Level1)
240 {
241     /**
242      * @tc.steps:step1. call StartTransaction interface.
243      * @tc.expected: step1. call succeed.
244      */
245     /**
246      * @tc.steps:step2. put (k1, v1) to db.
247      * @tc.expected: step2. put succeed.
248      */
249     /**
250      * @tc.steps:step3. call commit interface.
251      * @tc.expected: step3. call succeed.
252      */
253     /**
254      * @tc.steps:step4. use snapshot interface to check if (k1, v1) is put succeed.
255      * @tc.expected: step4. can find (k1, v1) from db.
256      */
257     DistributedDBInterfacesTransactionTestCase::Commit003(g_kvDelegatePtr, g_snapshotDelegatePtr);
258 }
259 
260 /**
261   * @tc.name: Commit004
262   * @tc.desc: Test that can commit Transaction after update record.
263   * @tc.type: FUNC
264   * @tc.require: AR000BVRNK AR000CQDTO
265   * @tc.author: huangnaigu
266   */
267 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit004, TestSize.Level1)
268 {
269     /**
270      * @tc.steps:step1. call StartTransaction interface.
271      * @tc.expected: step1. call succeed.
272      */
273     /**
274      * @tc.steps:step2. update value = v2 where key = k1.
275      * @tc.expected: step2. update succeed.
276      */
277     /**
278      * @tc.steps:step3. call commit interface.
279      * @tc.expected: step3. commit succeed.
280      */
281     /**
282      * @tc.steps:step4. use snapshot interface to check if (k1, v2) is update succeed.
283      * @tc.expected: step4. the value is v2 where key = k1 in the db.
284      */
285     DistributedDBInterfacesTransactionTestCase::Commit004(g_kvDelegatePtr, g_snapshotDelegatePtr);
286 }
287 
288 /**
289   * @tc.name: Commit005
290   * @tc.desc: Test that can commit Transaction after delete record.
291   * @tc.type: FUNC
292   * @tc.require: AR000BVRNK AR000CQDTO
293   * @tc.author: huangnaigu
294   */
295 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit005, TestSize.Level1)
296 {
297     /**
298      * @tc.steps:step1. call StartTransaction interface.
299      * @tc.expected: step1. call succeed.
300      */
301     /**
302      * @tc.steps:step2. delete record from db where key = k1.
303      * @tc.expected: step2. delete succeed.
304      */
305     /**
306      * @tc.steps:step3. call commit interface.
307      * @tc.expected: step3. commit succeed.
308      */
309     /**
310      * @tc.steps:step4. use snapshot interface to check if (k1, v1) is delete succeed.
311      * @tc.expected: step4. can't find (k1, v1) in the db.
312      */
313     DistributedDBInterfacesTransactionTestCase::Commit005(g_kvDelegatePtr, g_snapshotDelegatePtr);
314 }
315 
316 /**
317   * @tc.name: Commit006
318   * @tc.desc: Test that can commit Transaction after clear all the records.
319   * @tc.type: FUNC
320   * @tc.require: AR000BVRNK AR000CQDTO
321   * @tc.author: huangnaigu
322   */
323 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit006, TestSize.Level1)
324 {
325     /**
326      * @tc.steps:step1. call StartTransaction interface.
327      * @tc.expected: step1. call succeed.
328      */
329     /**
330      * @tc.steps:step2. clear all the records from db.
331      * @tc.expected: step2. clear succeed.
332      */
333     /**
334      * @tc.steps:step3. call commit interface.
335      * @tc.expected: step3. commit succeed.
336      */
337     /**
338      * @tc.steps:step4. use snapshot interface to check if there are any data in db.
339      * @tc.expected: step4. can't find any data in db.
340      */
341     DistributedDBInterfacesTransactionTestCase::Commit006(g_kvDelegatePtr, g_snapshotDelegatePtr);
342 }
343 
344 /**
345   * @tc.name: Commit007
346   * @tc.desc: Test that can commit Transaction after delete and update db.
347   * @tc.type: FUNC
348   * @tc.require: AR000BVRNK AR000CQDTO
349   * @tc.author: huangnaigu
350   */
351 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit007, TestSize.Level1)
352 {
353     /**
354      * @tc.steps:step1. call StartTransaction interface.
355      * @tc.expected: step1. call succeed.
356      */
357     /**
358      * @tc.steps:step2. delete record from db where key = k1.
359      * @tc.expected: step2. delete succeed.
360      */
361     /**
362      * @tc.steps:step3. put (k2, v1) to db.
363      * @tc.expected: step3. put succeed.
364      */
365     /**
366      * @tc.steps:step4. call commit interface.
367      * @tc.expected: step4. commit succeed.
368      */
369     /**
370      * @tc.steps:step5. use snapshot interface to check the data in db.
371      * @tc.expected: step5. can't find (k1, v1) but can find (k2, v1) in db.
372      */
373     DistributedDBInterfacesTransactionTestCase::Commit007(g_kvDelegatePtr, g_snapshotDelegatePtr);
374 }
375 
376 /**
377   * @tc.name: Commit008
378   * @tc.desc: Test that can commit Transaction after clear and new add records.
379   * @tc.type: FUNC
380   * @tc.require: AR000BVRNK AR000CQDTO
381   * @tc.author: huangnaigu
382   */
383 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, Commit008, TestSize.Level1)
384 {
385     /**
386      * @tc.steps:step1. call StartTransaction interface.
387      * @tc.expected: step1. call succeed.
388      */
389     /**
390      * @tc.steps:step2. clear all the records from db.
391      * @tc.expected: step2. clear succeed.
392      */
393     /**
394      * @tc.steps:step3. put (k3, v3) to db.
395      * @tc.expected: step3. put succeed.
396      */
397     /**
398      * @tc.steps:step4. call commit interface.
399      * @tc.expected: step4. commit succeed.
400      */
401     /**
402      * @tc.steps:step5. use snapshot interface to check the data in db.
403      * @tc.expected: step5. can only find (k3, v3) in db.
404      */
405     DistributedDBInterfacesTransactionTestCase::Commit008(g_kvDelegatePtr, g_snapshotDelegatePtr);
406 }
407 
408 /**
409  * @tc.name: RollBack001
410  * @tc.desc: Test if new commit records and logs generated
411  *  when a transaction rollback-ed
412  * @tc.type: FUNC
413  * @tc.require: AR000BVRNM AR000CQDTQ
414  * @tc.author: huangnaigu
415  */
416 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack001, TestSize.Level1)
417 {
418     /**
419      * @tc.steps:step1. Test g_kvDelegatePtr->Rollback
420      * @tc.expected: step1. Return ERROR.
421      */
422     DistributedDBInterfacesTransactionTestCase::RollBack001(g_kvDelegatePtr);
423 }
424 
425 /**
426 * @tc.name: RollBack002
427 * @tc.desc: rollback a transaction two times
428 * @tc.type: FUNC
429 * @tc.require: AR000BVRNM AR000CQDTQ
430 * @tc.author: huangnaigu
431 */
432 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack002, TestSize.Level1)
433 {
434     /**
435      * @tc.steps:step1. start a transaction
436      * @tc.expected: step1. Return OK.
437      */
438     /**
439      * @tc.steps:step2. rollback the transaction
440      * @tc.expected: step2. Return OK.
441      */
442     /**
443      * @tc.steps:step3. rollback the transaction the second time
444      * @tc.expected: step3. Return ERROR.
445      */
446     DistributedDBInterfacesTransactionTestCase::RollBack002(g_kvDelegatePtr);
447 }
448 
449 /**
450  * @tc.name: RollBack003
451  * @tc.desc: insert a data and rollback
452  * @tc.type: FUNC
453  * @tc.require: AR000BVRNM AR000CQDTQ
454  * @tc.author: huangnaigu
455  */
456 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack003, TestSize.Level1)
457 {
458     /**
459      * @tc.steps:step1. start a transaction
460      * @tc.expected: step1. Return OK.
461      */
462     /**
463      * @tc.steps:step2. Put (k1,v1)
464      * @tc.expected: step2. Return OK.
465      */
466     /**
467      * @tc.steps:step3. rollback a transaction
468      * @tc.expected: step3. Return OK.
469      */
470     /**
471      * @tc.steps:step4. check if (k1,v1) exists
472      * @tc.expected: step4. Return NOT_FOUND.
473      */
474     DistributedDBInterfacesTransactionTestCase::RollBack003(g_kvDelegatePtr, g_snapshotDelegatePtr);
475 }
476 
477 /**
478  * @tc.name: RollBack004
479  * @tc.desc: update a data and rollback
480  * @tc.type: FUNC
481  * @tc.require: AR000BVRNM AR000CQDTQ
482  * @tc.author: huangnaigu
483  */
484 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack004, TestSize.Level1)
485 {
486     /**
487      * @tc.steps:step1. Put (k1,v1)
488      * @tc.expected: step1. Return OK.
489      */
490     /**
491      * @tc.steps:step2. start a transaction
492      * @tc.expected: step2. Return OK.
493      */
494     /**
495      * @tc.steps:step3. Update (k1,v1) to (k1,v2) in the transaction
496      * @tc.expected: step3. Return OK.
497      */
498     /**
499      * @tc.steps:step4. rollback the transaction
500      * @tc.expected: step4. Return OK.
501      */
502     /**
503      * @tc.steps:step5. check the value of k1 is v1
504      * @tc.expected: step5. verification is OK .
505      */
506     DistributedDBInterfacesTransactionTestCase::RollBack004(g_kvDelegatePtr, g_snapshotDelegatePtr);
507 }
508 
509 /**
510  * @tc.name: RollBack005
511  * @tc.desc: delete an exist data and rollback
512  * @tc.type: FUNC
513  * @tc.require: AR000BVRNM AR000CQDTQ
514  * @tc.author: huangnaigu
515  */
516 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack005, TestSize.Level1)
517 {
518     /**
519      * @tc.steps:step1. Put (k1,v1)
520      * @tc.expected: step1. Return OK.
521      */
522     /**
523      * @tc.steps:step2. start a transaction
524      * @tc.expected: step2. Return OK.
525      */
526     /**
527      * @tc.steps:step3. Delete (k1,v1) in the transaction
528      * @tc.expected: step3. Return OK.
529      */
530     /**
531      * @tc.steps:step4. rollback the transaction
532      * @tc.expected: step4. Return OK.
533      */
534     /**
535      * @tc.steps:step5. check the value of k1 is v1
536      * @tc.expected: step5. verification is OK .
537      */
538     DistributedDBInterfacesTransactionTestCase::RollBack005(g_kvDelegatePtr, g_snapshotDelegatePtr);
539 }
540 
541 /**
542  * @tc.name: RollBack006
543  * @tc.desc: clear db and rollback
544  * @tc.type: FUNC
545  * @tc.require: AR000BVRNM AR000CQDTQ
546  * @tc.author: huangnaigu
547  */
548 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack006, TestSize.Level1)
549 {
550     /**
551      * @tc.steps:step1. PutBatch records: (k1,v1), (k2,v2)
552      * @tc.expected: step1. Return OK.
553      */
554     /**
555      * @tc.steps:step2. start a transaction
556      * @tc.expected: step2. Return OK.
557      */
558     /**
559      * @tc.steps:step3. Clear all records in the transaction
560      * @tc.expected: step3. Return OK.
561      */
562     /**
563      * @tc.steps:step4. rollback the transaction
564      * @tc.expected: step4. Return OK.
565      */
566     /**
567      * @tc.steps:step5. check if there are 2 records in the db
568      * @tc.expected: step5. verification is OK .
569      */
570     DistributedDBInterfacesTransactionTestCase::RollBack006(g_kvDelegatePtr, g_snapshotDelegatePtr);
571 }
572 
573 /**
574  * @tc.name: RollBack007
575  * @tc.desc: delete a exist data and update a data and rollback
576  * @tc.type: FUNC
577  * @tc.require: AR000BVRNM AR000CQDTQ
578  * @tc.author: huangnaigu
579  */
580 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack007, TestSize.Level1)
581 {
582     /**
583      * @tc.steps:step1. PutBatch records: (k1,v1), (k2,v2)
584      * @tc.expected: step1. Return OK.
585      */
586     /**
587      * @tc.steps:step2. start a transaction
588      * @tc.expected: step2. Return OK.
589      */
590     /**
591      * @tc.steps:step3. Delete (k1,v1) in the transaction
592      * @tc.expected: step3. Return OK.
593      */
594     /**
595      * @tc.steps:step4. Update (k2,v2) to (k2,v1) in the transaction
596      * @tc.expected: step4. Return OK.
597      */
598     /**
599      * @tc.steps:step5. rollback the transaction
600      * @tc.expected: step5. Return OK.
601      */
602     /**
603      * @tc.steps:step6. check if (k1,v1),(k2,v2) exist and no more records in the db
604      * @tc.expected: step6. verification is OK .
605      */
606     DistributedDBInterfacesTransactionTestCase::RollBack007(g_kvDelegatePtr, g_snapshotDelegatePtr);
607 }
608 
609 /**
610  * @tc.name: RollBack008
611  * @tc.desc: clear db and insert a data and rollback
612  * @tc.type: FUNC
613  * @tc.require: AR000BVRNM AR000CQDTQ
614  * @tc.author: huangnaigu
615  */
616 HWTEST_F(DistributedDBInterfacesTransactionSyncDBTest, RollBack008, TestSize.Level1)
617 {
618     /**
619      * @tc.steps:step1. PutBatch records: (k1,v1), (k2,v2)
620      * @tc.expected: step1. Return OK.
621      */
622     /**
623      * @tc.steps:step2. start a transaction
624      * @tc.expected: step2. Return OK.
625      */
626     /**
627      * @tc.steps:step3. Clear all records in the transaction
628      * @tc.expected: step3. Return OK.
629      */
630     /**
631      * @tc.steps:step4. Put (012, ABC) in the transaction
632      * @tc.expected: step4. Return OK.
633      */
634     /**
635      * @tc.steps:step5. rollback the transaction
636      * @tc.expected: step5. Return OK.
637      */
638     /**
639      * @tc.steps:step6. check if (k1,v1),(k2,v2) exist and no more records in the db
640      * @tc.expected: step6. verification is OK .
641      */
642     DistributedDBInterfacesTransactionTestCase::RollBack008(g_kvDelegatePtr, g_snapshotDelegatePtr);
643 }
644 #endif // OMIT_MULTI_VER