X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Ftest_hc.h;h=7e98043a54080ec89d9288157b58d30e57b80a61;hb=ea129fa14c89d8f5cedacd9afc1e4dd7a30f1ae4;hp=cbb8726cff3e06921edffb3f0acd8624f6bf692d;hpb=65ac2f814cdd9dc0f71ee35868dc6c75a7f69d6a;p=ric-app%2Fhw.git diff --git a/test/test_hc.h b/test/test_hc.h index cbb8726..7e98043 100644 --- a/test/test_hc.h +++ b/test/test_hc.h @@ -1,7 +1,7 @@ /* ================================================================================== - Copyright (c) 2018-2019 AT&T Intellectual Property. + Copyright (c) 2019-2020 AT&T Intellectual Property. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ #include "xapp.hpp" #define HC_MSG_SIZE 512 + using namespace std; TEST(Xapp, RMRHealthCheck){ @@ -38,7 +39,7 @@ TEST(Xapp, RMRHealthCheck){ std::unique_ptr rmr; rmr = std::make_unique("4560",num_attempts); - rmr->xapp_rmr_init(); + rmr->xapp_rmr_init(true); XappSettings config; @@ -61,15 +62,16 @@ TEST(Xapp, RMRHealthCheck){ bool res = rmr->xapp_rmr_send(&hdr,(void*)strMsg); usleep(1); } - sleep(10); + sleep(2); hw_xapp->stop(); - sleep(10); - }; + +}; TEST(Xapp, A1HealthCheck){ //Read the json file and send it using rmr. - string json = "{\"policy_type_id\": \"1\",\"policy_instance_id\":\"3d2157af-6a8f-4a7c-810f-38c2f824bf12\",\"operation\": \"CREATE\"}"; + //string json = "{\"policy_type_id\": \"1\",\"policy_instance_id\":\"3d2157af-6a8f-4a7c-810f-38c2f824bf12\",\"operation\": \"CREATE\"}"; + string json = "{\"operation\": \"CREATE\", \"policy_type_id\": 1, \"policy_instance_id\": \"hwpolicy321\", \"payload\": {\"threshold\": 5}}"; int n = json.length(); char strMsg[n + 1]; strcpy(strMsg, json.c_str()); @@ -80,7 +82,7 @@ TEST(Xapp, A1HealthCheck){ std::unique_ptr rmr; rmr = std::make_unique("4560",num_attempts); - rmr->xapp_rmr_init(); + rmr->xapp_rmr_init(true); XappSettings config; @@ -106,8 +108,6 @@ TEST(Xapp, A1HealthCheck){ bool res_msg2 = rmr->xapp_rmr_send(&hdr,(void*)strMsg); ASSERT_TRUE(res_msg2); - sleep(10); + sleep(2); hw_xapp->stop(); - sleep(10); - }