aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/libstore')
-rw-r--r--tests/unit/libstore/serve-protocol.cc77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/unit/libstore/serve-protocol.cc b/tests/unit/libstore/serve-protocol.cc
index b67b19dbf..138f31b47 100644
--- a/tests/unit/libstore/serve-protocol.cc
+++ b/tests/unit/libstore/serve-protocol.cc
@@ -227,6 +227,83 @@ VERSIONED_CHARACTERIZATION_TEST(
VERSIONED_CHARACTERIZATION_TEST(
ServeProtoTest,
+ unkeyedValidPathInfo_2_3,
+ "unkeyed-valid-path-info-2.3",
+ 2 << 8 | 3,
+ (std::tuple<UnkeyedValidPathInfo, UnkeyedValidPathInfo> {
+ ({
+ UnkeyedValidPathInfo info { Hash::dummy };
+ info.narSize = 34878;
+ info;
+ }),
+ ({
+ UnkeyedValidPathInfo info { Hash::dummy };
+ info.deriver = StorePath {
+ "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
+ };
+ info.references = {
+ StorePath {
+ "g1w7hyyyy1w7hy3qg1w7hy3qgqqqqy3q-foo.drv",
+ },
+ };
+ info.narSize = 34878;
+ info;
+ }),
+ }))
+
+VERSIONED_CHARACTERIZATION_TEST(
+ ServeProtoTest,
+ unkeyedValidPathInfo_2_4,
+ "unkeyed-valid-path-info-2.4",
+ 2 << 8 | 4,
+ (std::tuple<UnkeyedValidPathInfo, UnkeyedValidPathInfo> {
+ ({
+ UnkeyedValidPathInfo info {
+ Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
+ };
+ info.deriver = StorePath {
+ "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
+ };
+ info.references = {
+ StorePath {
+ "g1w7hyyyy1w7hy3qg1w7hy3qgqqqqy3q-foo.drv",
+ },
+ };
+ info.narSize = 34878;
+ info;
+ }),
+ ({
+ ValidPathInfo info {
+ *LibStoreTest::store,
+ "foo",
+ FixedOutputInfo {
+ .method = FileIngestionMethod::Recursive,
+ .hash = hashString(HashType::htSHA256, "(...)"),
+ .references = {
+ .others = {
+ StorePath {
+ "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar",
+ },
+ },
+ .self = true,
+ },
+ },
+ Hash::parseSRI("sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc="),
+ };
+ info.deriver = StorePath {
+ "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv",
+ };
+ info.narSize = 34878;
+ info.sigs = {
+ "fake-sig-1",
+ "fake-sig-2",
+ },
+ static_cast<UnkeyedValidPathInfo>(std::move(info));
+ }),
+ }))
+
+VERSIONED_CHARACTERIZATION_TEST(
+ ServeProtoTest,
vector,
"vector",
defaultVersion,