summaryrefslogtreecommitdiff
path: root/test/kdm_cli_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-04-26 22:39:12 +0200
committerCarl Hetherington <cth@carlh.net>2026-04-26 22:39:12 +0200
commit25ac279e5b7ae6593185230a0fe5a4022a6f689d (patch)
tree8162b3f10653fcfe06801342917b4e1df123d5a5 /test/kdm_cli_test.cc
parent72d4e2249dc6af0a31f04ff412a7eae84ac3cc4f (diff)
Warn if you specify trusted devices with a formulation that won't use them.
Diffstat (limited to 'test/kdm_cli_test.cc')
-rw-r--r--test/kdm_cli_test.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/kdm_cli_test.cc b/test/kdm_cli_test.cc
index 4bc3ddf46..b5088b938 100644
--- a/test/kdm_cli_test.cc
+++ b/test/kdm_cli_test.cc
@@ -364,3 +364,29 @@ BOOST_AUTO_TEST_CASE(kdm_cli_add_dkdm)
BOOST_CHECK_EQUAL(dkdm->dkdm().as_xml(), dcp::file_to_string("test/data/dkdm.xml"));
}
+
+BOOST_AUTO_TEST_CASE(kdm_cli_formulation_warning)
+{
+ vector<string> args = {
+ "kdm_cli",
+ "--valid-from", "now",
+ "--valid-duration", "2 weeks",
+ "--trusted-device-chain", "test/data/decryption_chain",
+ "--projector-certificate", "test/data/cert.pem",
+ "-S", "my great screen",
+ "-o", "build/test",
+ "test/data/dkdm.xml"
+ };
+
+ boost::filesystem::path const kdm_filename = "build/test/KDM_Test_FTR-1_F-133_XX-XX_MOS_2K_20220109_SMPTE_OV__my_great_screen.xml";
+ boost::system::error_code ec;
+ boost::filesystem::remove(kdm_filename, ec);
+
+ vector<string> output;
+ auto error = run(args, output);
+ BOOST_CHECK(!error);
+ BOOST_REQUIRE_EQUAL(output.size(), 1U);
+ BOOST_CHECK(output[0].find("the KDM formulation you specified will not write them to the KDM") != std::string::npos);
+
+ BOOST_CHECK(boost::filesystem::exists(kdm_filename));
+}