blob: a566a24472abc8ed83911793da296c39d5f891c2 [file] [log] [blame]
Peter Qiuc0beca52015-09-03 11:25:46 -07001//
2// Copyright (C) 2011 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
Chris Masone34af2182011-08-22 11:59:36 -070016
Ben Chanc45688b2014-07-02 23:50:45 -070017#ifndef SHILL_MOCK_IPCONFIG_H_
18#define SHILL_MOCK_IPCONFIG_H_
Chris Masone34af2182011-08-22 11:59:36 -070019
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080020#include <string>
Peter Qiua89154b2014-05-23 15:45:42 -070021#include <vector>
Hristo Stefanoved2c28c2011-11-29 15:37:30 -080022
Ben Chancc67c522014-09-03 07:19:18 -070023#include <base/macros.h>
Chris Masone34af2182011-08-22 11:59:36 -070024#include <gmock/gmock.h>
25
26#include "shill/ipconfig.h"
27
28namespace shill {
Chris Masone34af2182011-08-22 11:59:36 -070029
30class MockIPConfig : public IPConfig {
31 public:
Paul Stewart1e006c62015-06-16 12:29:06 -070032 MockIPConfig(ControlInterface* control_interface,
33 const std::string& device_name);
Ben Chan5ea763b2014-08-13 11:07:54 -070034 ~MockIPConfig() override;
Chris Masone34af2182011-08-22 11:59:36 -070035
Paul Stewart1e006c62015-06-16 12:29:06 -070036 MOCK_CONST_METHOD0(properties, const Properties& (void));
Chris Masone34af2182011-08-22 11:59:36 -070037 MOCK_METHOD0(RequestIP, bool(void));
38 MOCK_METHOD0(RenewIP, bool(void));
Paul Stewart217c61d2013-06-13 15:12:02 -070039 MOCK_METHOD1(ReleaseIP, bool(ReleaseReason reason));
Paul Stewartc5099532013-12-12 07:53:15 -080040 MOCK_METHOD0(ResetProperties, void(void));
mukesh agrawal7aed61c2013-04-22 16:01:24 -070041 MOCK_METHOD0(EmitChanges, void(void));
Peter Qiua89154b2014-05-23 15:45:42 -070042 MOCK_METHOD1(UpdateDNSServers,
Paul Stewart1e006c62015-06-16 12:29:06 -070043 void(const std::vector<std::string>& dns_servers));
Samuel Tan815a6fb2014-10-23 16:53:59 -070044 MOCK_METHOD1(UpdateLeaseExpirationTime, void(uint32_t new_lease_duration));
45 MOCK_METHOD0(ResetLeaseExpirationTime, void(void));
Darin Petkovef34f182011-08-26 14:14:40 -070046
47 private:
Paul Stewart1e006c62015-06-16 12:29:06 -070048 const Properties& real_properties() {
Thieu Le03026662013-04-04 10:45:11 -070049 return IPConfig::properties();
50 }
51
Darin Petkovef34f182011-08-26 14:14:40 -070052 DISALLOW_COPY_AND_ASSIGN(MockIPConfig);
Chris Masone34af2182011-08-22 11:59:36 -070053};
54
55} // namespace shill
56
Ben Chanc45688b2014-07-02 23:50:45 -070057#endif // SHILL_MOCK_IPCONFIG_H_