container_unix_mock.h 1.5 KB
Newer Older
L
LiFeng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/******************************************************************************
 * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
 * iSulad licensed under the Mulan PSL v1.
 * You can use this software according to the terms and conditions of the Mulan PSL v1.
 * You may obtain a copy of Mulan PSL v1 at:
 *     http://license.coscl.org.cn/MulanPSL
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
 * PURPOSE.
 * See the Mulan PSL v1 for more details.
 * Author: lifeng
 * Create: 2020-02-14
 * Description: provide container unix mock
 ******************************************************************************/

#ifndef CONTAINER_UNIX_MOCK_H_
#define CONTAINER_UNIX_MOCK_H_

#include <gmock/gmock.h>
#include "container_unix.h"

class MockContainerUnix {
public:
    virtual ~MockContainerUnix() = default;
    MOCK_METHOD2(HasMountFor, bool(container_t *cont, const char *mpath));
J
j00502727 已提交
26 27 28
    MOCK_METHOD1(ContainerToDisk, int(const container_t *cont));
    MOCK_METHOD1(ContainerUnlock, void(const container_t *cont));
    MOCK_METHOD1(ContainerLock, void(const container_t *cont));
L
LiFeng 已提交
29
    MOCK_METHOD1(ContainerUnref, void(container_t *cont));
J
j00502727 已提交
30
    MOCK_METHOD2(ContainerUpdateRestartManager, void(container_t *cont, const host_config_restart_policy *policy));
L
LiFeng 已提交
31 32 33 34
};

void MockContainerUnix_SetMock(MockContainerUnix* mock);

J
j00502727 已提交
35
#endif  // CONTAINER_UNIX_MOCK_H_