Zhiyi Zhang | daf2fd7 | 2017-01-19 11:31:35 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Zhiyi Zhang | af7c290 | 2019-03-14 22:13:21 -0700 | [diff] [blame] | 3 | * Copyright (c) 2017-2019, Regents of the University of California. |
Zhiyi Zhang | daf2fd7 | 2017-01-19 11:31:35 -0800 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndncert, a certificate management system based on NDN. |
| 6 | * |
| 7 | * ndncert is free software: you can redistribute it and/or modify it under the terms |
| 8 | * of the GNU General Public License as published by the Free Software Foundation, either |
| 9 | * version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndncert is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License along with |
| 16 | * ndncert, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 17 | * |
| 18 | * See AUTHORS.md for complete list of ndncert authors and contributors. |
| 19 | */ |
| 20 | |
Zhiyi Zhang | daf2fd7 | 2017-01-19 11:31:35 -0800 | [diff] [blame] | 21 | #include "ca-config.hpp" |
Zhiyi Zhang | ad6cf93 | 2017-10-26 16:19:15 -0700 | [diff] [blame] | 22 | |
| 23 | #include "identity-management-fixture.hpp" |
Zhiyi Zhang | daf2fd7 | 2017-01-19 11:31:35 -0800 | [diff] [blame] | 24 | #include <ndn-cxx/security/transform/base64-encode.hpp> |
| 25 | #include <ndn-cxx/security/transform/buffer-source.hpp> |
| 26 | #include <ndn-cxx/security/transform/stream-sink.hpp> |
| 27 | |
| 28 | namespace ndn { |
| 29 | namespace ndncert { |
| 30 | namespace tests { |
| 31 | |
Zhiyi Zhang | af7c290 | 2019-03-14 22:13:21 -0700 | [diff] [blame] | 32 | BOOST_FIXTURE_TEST_SUITE(TestCaConfig, IdentityManagementFixture) |
Zhiyi Zhang | daf2fd7 | 2017-01-19 11:31:35 -0800 | [diff] [blame] | 33 | |
| 34 | BOOST_AUTO_TEST_CASE(ReadConfigFileWithFileAnchor) |
| 35 | { |
Zhiyi Zhang | 06d6ae9 | 2017-03-08 14:59:45 -0800 | [diff] [blame] | 36 | CaConfig config; |
| 37 | config.load("tests/unit-tests/ca.conf.test"); |
Zhiyi Zhang | af7c290 | 2019-03-14 22:13:21 -0700 | [diff] [blame] | 38 | BOOST_CHECK_EQUAL(config.m_caName.toUri(), "/ndn"); |
| 39 | BOOST_CHECK_EQUAL(config.m_freshnessPeriod, time::seconds(720)); |
| 40 | BOOST_CHECK_EQUAL(config.m_validityPeriod, time::days(360)); |
| 41 | BOOST_CHECK_EQUAL(config.m_probe, "input email address"); |
| 42 | BOOST_CHECK_EQUAL(config.m_caInfo, "ndn testbed ca"); |
Zhiyi Zhang | daf2fd7 | 2017-01-19 11:31:35 -0800 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | BOOST_AUTO_TEST_SUITE_END() // TestCaConfig |
| 46 | |
| 47 | } // namespace tests |
| 48 | } // namespace ndncert |
| 49 | } // namespace ndn |