19762338dSopenharmony_ci/*
29762338dSopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
39762338dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
49762338dSopenharmony_ci * you may not use this file except in compliance with the License.
59762338dSopenharmony_ci * You may obtain a copy of the License at
69762338dSopenharmony_ci *
79762338dSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
89762338dSopenharmony_ci *
99762338dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
109762338dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
119762338dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
129762338dSopenharmony_ci * See the License for the specific language governing permissions and
139762338dSopenharmony_ci * limitations under the License.
149762338dSopenharmony_ci */
159762338dSopenharmony_ci
169762338dSopenharmony_ci#include <gtest/gtest.h>
179762338dSopenharmony_ci#include <osal_mem.h>
189762338dSopenharmony_ci#include <unistd.h>
199762338dSopenharmony_ci#include "hdf_log.h"
209762338dSopenharmony_ci#include "idevmgr_hdi.h"
219762338dSopenharmony_ci#include "v1_0/ipartition_slot.h"
229762338dSopenharmony_ci
239762338dSopenharmony_ciusing namespace testing;
249762338dSopenharmony_ciusing namespace testing::ext;
259762338dSopenharmony_ciusing namespace OHOS::HDI::Partitionslot::V1_0;
269762338dSopenharmony_ciusing OHOS::HDI::DeviceManager::V1_0::IDeviceManager;
279762338dSopenharmony_ci
289762338dSopenharmony_ciclass StartupPartitionSlotTest : public testing::Test {
299762338dSopenharmony_ci   public:
309762338dSopenharmony_ci    static void SetUpTestCase()
319762338dSopenharmony_ci    {
329762338dSopenharmony_ci        auto devmgr = IDeviceManager::Get();
339762338dSopenharmony_ci        if (devmgr != nullptr) {
349762338dSopenharmony_ci            devmgr->LoadDevice("partition_slot_service");
359762338dSopenharmony_ci        } else {
369762338dSopenharmony_ci            std::cout << "Get devmgr failed" << std::endl;
379762338dSopenharmony_ci        }
389762338dSopenharmony_ci    }
399762338dSopenharmony_ci    static void TearDownTestCase()
409762338dSopenharmony_ci    {
419762338dSopenharmony_ci        auto devmgr = IDeviceManager::Get();
429762338dSopenharmony_ci        if (devmgr != nullptr) {
439762338dSopenharmony_ci            devmgr->UnloadDevice("partition_slot_service");
449762338dSopenharmony_ci        } else {
459762338dSopenharmony_ci            std::cout << "Get devmgr failed" << std::endl;
469762338dSopenharmony_ci        }
479762338dSopenharmony_ci    }
489762338dSopenharmony_ci    void SetUp() {}
499762338dSopenharmony_ci    void TearDown() {}
509762338dSopenharmony_ci};
519762338dSopenharmony_ci
529762338dSopenharmony_ci/**
539762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_001
549762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun001
559762338dSopenharmony_ci * @tc.desc: NA
569762338dSopenharmony_ci */
579762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_001, Function | MediumTest | Level1) {
589762338dSopenharmony_ci    std::cout << "begin get currentslot by service" << std::endl;
599762338dSopenharmony_ci    int numOfSlots = 0;
609762338dSopenharmony_ci    int currentSlot = -1;
619762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
629762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
639762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetCurrentSlot(currentSlot, numOfSlots) == 0);
649762338dSopenharmony_ci}
659762338dSopenharmony_ci/**
669762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_002
679762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun002
689762338dSopenharmony_ci * @tc.desc: NA
699762338dSopenharmony_ci */
709762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_002, Function | MediumTest | Level1)
719762338dSopenharmony_ci{
729762338dSopenharmony_ci    std::cout << "begin get currentslot by service" << std::endl;
739762338dSopenharmony_ci    int numOfSlots = 1;
749762338dSopenharmony_ci    int currentSlot = 0;
759762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
769762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
779762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetCurrentSlot(currentSlot, numOfSlots) == 0);
789762338dSopenharmony_ci}
799762338dSopenharmony_ci/**
809762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_003
819762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun003
829762338dSopenharmony_ci * @tc.desc: NA
839762338dSopenharmony_ci */
849762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_003, Function | MediumTest | Level1)
859762338dSopenharmony_ci{
869762338dSopenharmony_ci    std::cout << "begin get currentslot by service" << std::endl;
879762338dSopenharmony_ci    int numOfSlots = 1;
889762338dSopenharmony_ci    int currentSlot = 1;
899762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
909762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
919762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetCurrentSlot(currentSlot, numOfSlots) == 0);
929762338dSopenharmony_ci}
939762338dSopenharmony_ci/**
949762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_004
959762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun004
969762338dSopenharmony_ci * @tc.desc: NA
979762338dSopenharmony_ci */
989762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_004, Function | MediumTest | Level1)
999762338dSopenharmony_ci{
1009762338dSopenharmony_ci    std::cout << "begin get currentslot by service" << std::endl;
1019762338dSopenharmony_ci    int numOfSlots = 2;
1029762338dSopenharmony_ci    int currentSlot = 2;
1039762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
1049762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
1059762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetCurrentSlot(currentSlot, numOfSlots) == 0);
1069762338dSopenharmony_ci}
1079762338dSopenharmony_ci/**
1089762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_005
1099762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun005
1109762338dSopenharmony_ci * @tc.desc: NA
1119762338dSopenharmony_ci */
1129762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_005, Function | MediumTest | Level1)
1139762338dSopenharmony_ci{
1149762338dSopenharmony_ci    std::cout << "begin get currentslot by service" << std::endl;
1159762338dSopenharmony_ci    int numOfSlots = 3;
1169762338dSopenharmony_ci    int currentSlot = 3;
1179762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
1189762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
1199762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetCurrentSlot(currentSlot, numOfSlots) == 0);
1209762338dSopenharmony_ci}
1219762338dSopenharmony_ci/**
1229762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_006
1239762338dSopenharmony_ci * @tc.name: testGetSlotSuffixFun001
1249762338dSopenharmony_ci * @tc.desc: NA
1259762338dSopenharmony_ci */
1269762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_006, Function | MediumTest | Level1)
1279762338dSopenharmony_ci{
1289762338dSopenharmony_ci    std::cout << "begin get suffix by service" << std::endl;
1299762338dSopenharmony_ci    std::string suffix = "";
1309762338dSopenharmony_ci    int slot = -1;
1319762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
1329762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
1339762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetSlotSuffix(slot, suffix) == 0);
1349762338dSopenharmony_ci}
1359762338dSopenharmony_ci/**
1369762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_007
1379762338dSopenharmony_ci * @tc.name: testGetSlotSuffixFun002
1389762338dSopenharmony_ci * @tc.desc: NA
1399762338dSopenharmony_ci */
1409762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_007, Function | MediumTest | Level1)
1419762338dSopenharmony_ci{
1429762338dSopenharmony_ci    std::cout << "begin get suffix by service" << std::endl;
1439762338dSopenharmony_ci    std::string suffix = "";
1449762338dSopenharmony_ci    int slot = 0;
1459762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
1469762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
1479762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetSlotSuffix(slot, suffix) == 0);
1489762338dSopenharmony_ci}
1499762338dSopenharmony_ci/**
1509762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_008
1519762338dSopenharmony_ci * @tc.name: testGetSlotSuffixFun003
1529762338dSopenharmony_ci * @tc.desc: NA
1539762338dSopenharmony_ci */
1549762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_008, Function | MediumTest | Level1)
1559762338dSopenharmony_ci{
1569762338dSopenharmony_ci    std::cout << "begin get suffix by service" << std::endl;
1579762338dSopenharmony_ci    std::string suffix = "";
1589762338dSopenharmony_ci    int slot = 1;
1599762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
1609762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
1619762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetSlotSuffix(slot, suffix) == 0);
1629762338dSopenharmony_ci}
1639762338dSopenharmony_ci/**
1649762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_002
1659762338dSopenharmony_ci * @tc.name: testGetSlotSuffixFun004
1669762338dSopenharmony_ci * @tc.desc: NA
1679762338dSopenharmony_ci */
1689762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_009, Function | MediumTest | Level1) {
1699762338dSopenharmony_ci    std::cout << "begin get suffix by service" << std::endl;
1709762338dSopenharmony_ci    std::string suffix = "";
1719762338dSopenharmony_ci    int slot = 2;
1729762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
1739762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
1749762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetSlotSuffix(slot, suffix) == 0);
1759762338dSopenharmony_ci}
1769762338dSopenharmony_ci/**
1779762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_010
1789762338dSopenharmony_ci * @tc.name: testGetSlotSuffixFun005
1799762338dSopenharmony_ci * @tc.desc: NA
1809762338dSopenharmony_ci */
1819762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_010, Function | MediumTest | Level1)
1829762338dSopenharmony_ci{
1839762338dSopenharmony_ci    std::cout << "begin get suffix by service" << std::endl;
1849762338dSopenharmony_ci    std::string suffix = "";
1859762338dSopenharmony_ci    int slot = 3;
1869762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
1879762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
1889762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->GetSlotSuffix(slot, suffix) == 0);
1899762338dSopenharmony_ci}
1909762338dSopenharmony_ci/**
1919762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_011
1929762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun001
1939762338dSopenharmony_ci * @tc.desc: NA
1949762338dSopenharmony_ci */
1959762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_011, Function | MediumTest | Level1)
1969762338dSopenharmony_ci{
1979762338dSopenharmony_ci    std::cout << "begin set active slot by service" << std::endl;
1989762338dSopenharmony_ci    int numOfSlots = 0;
1999762338dSopenharmony_ci    int currentSlot = -1;
2009762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
2019762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
2029762338dSopenharmony_ci    partitionslot->GetCurrentSlot(currentSlot, numOfSlots);
2039762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetActiveSlot(-1) != 0);
2049762338dSopenharmony_ci    partitionslot->SetActiveSlot(currentSlot);
2059762338dSopenharmony_ci}
2069762338dSopenharmony_ci/**
2079762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_012
2089762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun002
2099762338dSopenharmony_ci * @tc.desc: NA
2109762338dSopenharmony_ci */
2119762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_012, Function | MediumTest | Level1) {
2129762338dSopenharmony_ci    std::cout << "begin set active slot by service" << std::endl;
2139762338dSopenharmony_ci    int numOfSlots = 0;
2149762338dSopenharmony_ci    int currentSlot = 0;
2159762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
2169762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
2179762338dSopenharmony_ci    partitionslot->GetCurrentSlot(currentSlot, numOfSlots);
2189762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetActiveSlot(0) == 0);
2199762338dSopenharmony_ci    partitionslot->SetActiveSlot(currentSlot);
2209762338dSopenharmony_ci}
2219762338dSopenharmony_ci/**
2229762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_013
2239762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun003
2249762338dSopenharmony_ci * @tc.desc: NA
2259762338dSopenharmony_ci */
2269762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_013, Function | MediumTest | Level1)
2279762338dSopenharmony_ci{
2289762338dSopenharmony_ci    std::cout << "begin set active slot by service" << std::endl;
2299762338dSopenharmony_ci    int numOfSlots = 1;
2309762338dSopenharmony_ci    int currentSlot = 0;
2319762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
2329762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
2339762338dSopenharmony_ci    partitionslot->GetCurrentSlot(currentSlot, numOfSlots);
2349762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetActiveSlot(1) == 0);
2359762338dSopenharmony_ci    partitionslot->SetActiveSlot(currentSlot);
2369762338dSopenharmony_ci}
2379762338dSopenharmony_ci/**
2389762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_014
2399762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun004
2409762338dSopenharmony_ci * @tc.desc: NA
2419762338dSopenharmony_ci */
2429762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_014, Function | MediumTest | Level1)
2439762338dSopenharmony_ci{
2449762338dSopenharmony_ci    std::cout << "begin set active slot by service" << std::endl;
2459762338dSopenharmony_ci    int numOfSlots = 2;
2469762338dSopenharmony_ci    int currentSlot = 0;
2479762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
2489762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
2499762338dSopenharmony_ci    partitionslot->GetCurrentSlot(currentSlot, numOfSlots);
2509762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetActiveSlot(2) == 0);
2519762338dSopenharmony_ci    partitionslot->SetActiveSlot(currentSlot);
2529762338dSopenharmony_ci}
2539762338dSopenharmony_ci/**
2549762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_015
2559762338dSopenharmony_ci * @tc.name: testGetCurrentSlotFun005
2569762338dSopenharmony_ci * @tc.desc: NA
2579762338dSopenharmony_ci */
2589762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_015, Function | MediumTest | Level1)
2599762338dSopenharmony_ci{
2609762338dSopenharmony_ci    std::cout << "begin set active slot by service" << std::endl;
2619762338dSopenharmony_ci    int numOfSlots = 3;
2629762338dSopenharmony_ci    int currentSlot = 0;
2639762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
2649762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
2659762338dSopenharmony_ci    partitionslot->GetCurrentSlot(currentSlot, numOfSlots);
2669762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetActiveSlot(3) == 0);
2679762338dSopenharmony_ci    partitionslot->SetActiveSlot(currentSlot);
2689762338dSopenharmony_ci}
2699762338dSopenharmony_ci/**
2709762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_016
2719762338dSopenharmony_ci * @tc.name: testSetSlotUnbootableFun001
2729762338dSopenharmony_ci * @tc.desc: NA
2739762338dSopenharmony_ci */
2749762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_016, Function | MediumTest | Level1) {
2759762338dSopenharmony_ci    std::cout << "begin set unbootable slot by service" << std::endl;
2769762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
2779762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
2789762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetSlotUnbootable(-1) != 0);
2799762338dSopenharmony_ci}
2809762338dSopenharmony_ci/**
2819762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_017
2829762338dSopenharmony_ci * @tc.name: testSetSlotUnbootableFun002
2839762338dSopenharmony_ci * @tc.desc: NA
2849762338dSopenharmony_ci */
2859762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_017, Function | MediumTest | Level1)
2869762338dSopenharmony_ci{
2879762338dSopenharmony_ci    std::cout << "begin set unbootable slot by service" << std::endl;
2889762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
2899762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
2909762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetSlotUnbootable(0) == 0);
2919762338dSopenharmony_ci}
2929762338dSopenharmony_ci/**
2939762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_018
2949762338dSopenharmony_ci * @tc.name: testSetSlotUnbootableFun003
2959762338dSopenharmony_ci * @tc.desc: NA
2969762338dSopenharmony_ci */
2979762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_018, Function | MediumTest | Level1)
2989762338dSopenharmony_ci{
2999762338dSopenharmony_ci    std::cout << "begin set unbootable slot by service" << std::endl;
3009762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
3019762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
3029762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetSlotUnbootable(1) == 0);
3039762338dSopenharmony_ci}
3049762338dSopenharmony_ci/**
3059762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_019
3069762338dSopenharmony_ci * @tc.name: testSetSlotUnbootableFun004
3079762338dSopenharmony_ci * @tc.desc: NA
3089762338dSopenharmony_ci */
3099762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_019, Function | MediumTest | Level1)
3109762338dSopenharmony_ci{
3119762338dSopenharmony_ci    std::cout << "begin set unbootable slot by service" << std::endl;
3129762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
3139762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
3149762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetSlotUnbootable(2) == 0);
3159762338dSopenharmony_ci}
3169762338dSopenharmony_ci/**
3179762338dSopenharmony_ci * @tc.number: StartupPartitionSlotTest_020
3189762338dSopenharmony_ci * @tc.name: testSetSlotUnbootableFun005
3199762338dSopenharmony_ci * @tc.desc: NA
3209762338dSopenharmony_ci */
3219762338dSopenharmony_ciHWTEST_F(StartupPartitionSlotTest, StartupPartitionSlotTest_020, Function | MediumTest | Level1)
3229762338dSopenharmony_ci{
3239762338dSopenharmony_ci    std::cout << "begin set unbootable slot by service" << std::endl;
3249762338dSopenharmony_ci    sptr<IPartitionSlot> partitionslot = IPartitionSlot::Get();
3259762338dSopenharmony_ci    ASSERT_TRUE(partitionslot != nullptr);
3269762338dSopenharmony_ci    ASSERT_TRUE(partitionslot->SetSlotUnbootable(3) == 0);
3279762338dSopenharmony_ci}