blob: 01d838a7bede40c670c433771f7729e947870a7e [file] [log] [blame]
Yingdi Yu0a312e52015-07-22 13:14:53 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014-2015, Regents of the University of California.
4 *
5 * This file is part of ndn-tools (Named Data Networking Essential Tools).
6 * See AUTHORS.md for complete list of ndn-tools authors and contributors.
7 *
8 * ndn-tools is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * @author Yingdi Yu <yingdi@cs.ucla.edu>
20 */
21
22#ifndef NDN_TOOLS_TESTS_IDENTITY_MANAGEMENT_TIME_FIXTURE_HPP
23#define NDN_TOOLS_TESTS_IDENTITY_MANAGEMENT_TIME_FIXTURE_HPP
24
25#include <ndn-cxx/security/key-chain.hpp>
26#include <vector>
27#include <boost/filesystem.hpp>
28
29#include "tests/test-common.hpp"
30
31namespace ndn {
32namespace tests {
33
34/**
35 * @brief IdentityManagementTimeFixture is a test suite level fixture.
36 * Test cases in the suite can use this fixture to create identities.
37 * Identities added via addIdentity method are automatically deleted
38 * during test teardown.
39 */
40class IdentityManagementTimeFixture : public tests::UnitTestTimeFixture
41{
42public:
43 IdentityManagementTimeFixture();
44
45 ~IdentityManagementTimeFixture();
46
47 /// @brief add identity, return true if succeed.
48 bool
49 addIdentity(const Name& identity, const KeyParams& params = KeyChain::DEFAULT_KEY_PARAMS);
50
51protected:
52 boost::filesystem::path m_keyChainTmpPath;
53
54 KeyChain m_keyChain;
55 std::vector<Name> m_identities;
56};
57
58} // namespace tests
59} // namespace ndn
60
61#endif // NDN_TOOLS_TESTS_IDENTITY_MANAGEMENT_TIME_FIXTURE_HPP