blob: da0a0993cf11d49fd20457e49efa39b08a4ad42e [file] [log] [blame]
// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SHILL_MOCK_MINIJAIL_H_
#define SHILL_MOCK_MINIJAIL_H_
#include <base/basictypes.h>
#include <gmock/gmock.h>
#include "shill/minijail.h"
namespace shill {
class MockMinijail : public Minijail {
public:
MockMinijail();
virtual ~MockMinijail();
MOCK_METHOD0(New, struct minijail *());
MOCK_METHOD1(Destroy, void (struct minijail *));
MOCK_METHOD2(DropRoot, bool(struct minijail *jail, const char *user));
MOCK_METHOD2(UseCapabilities, void(struct minijail *jail, uint64_t capmask));
MOCK_METHOD3(Run, bool(struct minijail *jail,
std::vector<char *> args, pid_t *pid));
MOCK_METHOD3(RunSync, bool(struct minijail *jail,
std::vector<char *> args, int *status));
MOCK_METHOD3(RunAndDestroy, bool(struct minijail *jail,
std::vector<char *> args, pid_t *pid));
MOCK_METHOD3(RunSyncAndDestroy, bool(struct minijail *jail,
std::vector<char *> args, int *status));
MOCK_METHOD4(RunPipeAndDestroy, bool(struct minijail *jail,
std::vector<char *> args,
pid_t *pid, int *stdin));
MOCK_METHOD6(RunPipesAndDestroy, bool(struct minijail *jail,
std::vector<char *> args,
pid_t *pid, int *stdin,
int *stdout, int *stderr));
private:
DISALLOW_COPY_AND_ASSIGN(MockMinijail);
};
} // namespace shill
#endif // SHILL_MOCK_MINIJAIL_H_