blob: 507a9f11596a7af3a55b4e2d64afce8a11278a69 [file] [log] [blame]
Junxiao Shi047a6fb2017-06-08 16:16:05 +00001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Alexander Afanasyevc0e26582017-08-13 21:16:49 -04002/*
Davide Pesavento164ae3b2023-11-11 22:00:23 -05003 * Copyright (c) 2014-2023, Regents of the University of California.
Junxiao Shi047a6fb2017-06-08 16:16:05 +00004 *
5 * This file is part of NDN repo-ng (Next generation of NDN repository).
6 * See AUTHORS.md for complete list of repo-ng authors and contributors.
7 *
8 * repo-ng 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 * repo-ng 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 * repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef REPO_TESTS_INTEGRATED_COMMAND_FIXTURE_HPP
21#define REPO_TESTS_INTEGRATED_COMMAND_FIXTURE_HPP
22
23#include "../identity-management-fixture.hpp"
Junxiao Shi047a6fb2017-06-08 16:16:05 +000024
Davide Pesavento11904062022-04-14 22:33:28 -040025#include <ndn-cxx/mgmt/dispatcher.hpp>
26#include <ndn-cxx/security/validator-config.hpp>
27
28namespace repo::tests {
Junxiao Shi047a6fb2017-06-08 16:16:05 +000029
30class CommandFixture : public virtual IdentityManagementFixture
31{
32protected:
Davide Pesavento164ae3b2023-11-11 22:00:23 -050033 CommandFixture()
34 {
35 addIdentity("/ndn/test/repo");
36 saveIdentityCertificate("/ndn/test/repo", "tests/integrated/insert-delete-test.cert");
37 validator.load("tests/integrated/insert-delete-validator-config.conf");
38 }
Junxiao Shi047a6fb2017-06-08 16:16:05 +000039
40protected:
41 Face repoFace;
Davide Pesavento164ae3b2023-11-11 22:00:23 -050042 Scheduler scheduler{repoFace.getIoContext()};
43 ndn::mgmt::Dispatcher dispatcher{repoFace, m_keyChain};
Junxiao Shi047a6fb2017-06-08 16:16:05 +000044 /// \todo #4091 switch to ValidatorPolicyConf and load insert-delete-validator-config.conf
Davide Pesavento164ae3b2023-11-11 22:00:23 -050045 ndn::security::ValidatorConfig validator{repoFace};
Junxiao Shi047a6fb2017-06-08 16:16:05 +000046};
47
Davide Pesavento11904062022-04-14 22:33:28 -040048} // namespace repo::tests
Junxiao Shi047a6fb2017-06-08 16:16:05 +000049
50#endif // REPO_TESTS_INTEGRATED_COMMAND_FIXTURE_HPP