blob: 0f7d3c4a240a754efbfd90b497b20e248ce3432e [file] [log] [blame]
Yanbiao Lic17de832014-11-21 17:51:45 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Junxiao Shi38f4ce92016-08-04 10:01:52 +00003 * Copyright (c) 2014-2016, Regents of the University of California,
4 * Arizona Board of Regents,
5 * Colorado State University,
6 * University Pierre & Marie Curie, Sorbonne University,
7 * Washington University in St. Louis,
8 * Beijing Institute of Technology,
9 * The University of Memphis.
Yanbiao Lic17de832014-11-21 17:51:45 -080010 *
Junxiao Shi38f4ce92016-08-04 10:01:52 +000011 * This file is part of NFD (Named Data Networking Forwarding Daemon).
12 * See AUTHORS.md for complete list of NFD authors and contributors.
Yanbiao Lic17de832014-11-21 17:51:45 -080013 *
Junxiao Shi38f4ce92016-08-04 10:01:52 +000014 * NFD is free software: you can redistribute it and/or modify it under the terms
15 * of the GNU General Public License as published by the Free Software Foundation,
16 * either version 3 of the License, or (at your option) any later version.
Yanbiao Lic17de832014-11-21 17:51:45 -080017 *
Junxiao Shi38f4ce92016-08-04 10:01:52 +000018 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20 * PURPOSE. See the GNU General Public License for more details.
Yanbiao Lic17de832014-11-21 17:51:45 -080021 *
Junxiao Shi38f4ce92016-08-04 10:01:52 +000022 * You should have received a copy of the GNU General Public License along with
23 * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Yanbiao Lic17de832014-11-21 17:51:45 -080024 */
25
Yukai Tu0a49d342015-09-13 12:54:22 +080026#ifndef NFD_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
27#define NFD_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP
28
Yanbiao Lic17de832014-11-21 17:51:45 -080029#include "tests/test-common.hpp"
30#include <ndn-cxx/security/key-chain.hpp>
31#include <vector>
32
33#include "boost-test.hpp"
34
35namespace nfd {
36namespace tests {
37
38/**
39 * @brief IdentityManagementFixture is a test suite level fixture.
40 *
41 * Test cases in the suite can use this fixture to create identities.
42 * Identities added via addIdentity method are automatically deleted
43 * during test teardown.
44 */
Yukai Tu0a49d342015-09-13 12:54:22 +080045class IdentityManagementFixture : public virtual BaseFixture
Yanbiao Lic17de832014-11-21 17:51:45 -080046{
47public:
48 IdentityManagementFixture();
49
50 ~IdentityManagementFixture();
51
52 // @brief add identity, return true if succeed.
53 bool
54 addIdentity(const ndn::Name& identity,
55 const ndn::KeyParams& params = ndn::KeyChain::DEFAULT_KEY_PARAMS);
56
57protected:
58 ndn::KeyChain m_keyChain;
59 std::vector<ndn::Name> m_identities;
60};
61
Junxiao Shi38f4ce92016-08-04 10:01:52 +000062class IdentityManagementTimeFixture : public UnitTestTimeFixture
63 , public IdentityManagementFixture
64{
65};
66
Yanbiao Lic17de832014-11-21 17:51:45 -080067} // namespace tests
68} // namespace nfd
Yukai Tu0a49d342015-09-13 12:54:22 +080069
70#endif // NFD_TESTS_IDENTITY_MANAGEMENT_FIXTURE_HPP