validator: integrate validator-config for data validation
Change-Id: I782964f8d6ce9134b2b849425a13b82aef741e2f
refs #1479
diff --git a/tests/integrated/insert-delete-validator-config.conf b/tests/integrated/insert-delete-validator-config.conf
index e5a44f8..8a777c5 100644
--- a/tests/integrated/insert-delete-validator-config.conf
+++ b/tests/integrated/insert-delete-validator-config.conf
@@ -1,6 +1,6 @@
-; This test rule is for test suite TestBasicCommandInsertDelete.
-; Signed interests are generated by default certificate.
-; In this test rule, the type of checker is fixed signer and signer type is file.
+; The test rules below are for test suite TestBasicCommandInsertDelete.
+; Signed interests and data packets are signed by default certificate.
+; In these test rules, the type of checker is fixed signer and signer type is file.
; So user who wants to run this test could use security tool to dump the defualt
; certificate into a file named "insert-delete-test.cert"
rule
@@ -23,4 +23,26 @@
file-name "insert-delete-test.cert"
}
}
+}
+
+rule
+{
+ id "Test Rule For Datat"
+ for data
+ filter
+ {
+ type name
+ name /
+ relation is-prefix-of
+ }
+ checker
+ {
+ type fixed-signer
+ sig-type rsa-sha256
+ signer
+ {
+ type file
+ file-name "insert-delete-test.cert"
+ }
+ }
}
\ No newline at end of file
diff --git a/tests/integrated/test-basic-command-insert-delete.cpp b/tests/integrated/test-basic-command-insert-delete.cpp
index eed4764..db53f43 100644
--- a/tests/integrated/test-basic-command-insert-delete.cpp
+++ b/tests/integrated/test-basic-command-insert-delete.cpp
@@ -146,7 +146,7 @@
Data data(Name(interest.getName()));
data.setContent(content, sizeof(content));
data.setFreshnessPeriod(milliseconds(0));
- keyChain.sign(data);
+ keyChain.signByIdentity(data, keyChain.getDefaultIdentity());
insertFace.put(data);
std::map<Name, EventId>::iterator event = insertEvents.find(interest.getName());