test: add platon test_entry
@@ -26,6 +26,43 @@ extern Suite *make_wallet_suite(void);
// extern Suite *make_transactions_suite(void);
// extern Suite *make_contract_suite(void);
+char platon_private_key_buf[1024];
+
+int read_key_content(char* key_ptr)
+{
+ int fd = 0;
+ int len;
+
+ if (key_ptr == NULL)
+ {
+ return -1;
+ }
+
+ if (TEST_KEY_TYPE == BOAT_WALLET_PRIKEY_FORMAT_NATIVE)
+ {
+ fd = open("../../../tests/BoAT_platon_linuxDefault/pri_key/native.key", O_RDONLY);
+ if (fd < 0)
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ fd = open("../../../tests/BoAT_platon_linuxDefault/pri_key/pkcs_key.key", O_RDONLY);
+ if (fd < 0)
+ {
+ return -1;
+ }
+ }
+ len = read(fd, key_ptr, 1024);
+ if (len < 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
int main(int argc, char *argv[])
{
SRunner *sr = NULL;
@@ -36,6 +73,7 @@ int main(int argc, char *argv[])
// Suite *suite_paramters = make_parameters_suite();
// Suite *suite_transaction = make_transactions_suite();
// Suite *suite_contract = make_contract_suite();
+ read_key_content(palton_private_key_buf);
/* create srunner and add first suite to it.
The first suite in a suite runner is always added in function srunner_create,
