- printf("Cannot initialise power management for lcore %u, this "
- "may occur if environment is not configured "
- "correctly(KVM VM) or operating in another valid "
- "Power management environment\n", TEST_POWER_VM_LCORE_ID);
- rte_power_unset_env();
- return -1;
+ printf("rte_power_init failed as expected in host\n");
+ /* This test would be successful when run on VM,
+ * in order to run in Host itself, temporary file path
+ * is created and same is used for further communication
+ */
+
+ snprintf(fPath, PATH_MAX, "%s.%u",
+ TEMP_POWER_MANAGER_FILE_PATH, TEST_POWER_VM_LCORE_ID);
+ fPtr = fopen(fPath, "w");
+ if (fPtr == NULL) {
+ printf(" Unable to create file\n");
+ rte_power_unset_env();
+ return -1;
+ }
+ ret = guest_channel_host_connect(TEMP_POWER_MANAGER_FILE_PATH,
+ TEST_POWER_VM_LCORE_ID);
+ if (ret == 0)
+ printf("guest_channel_host_connect successful\n");
+ else {
+ printf("guest_channel_host_connect failed\n");
+ rte_power_unset_env();
+ fclose(fPtr);
+ remove(fPath);
+ return -1;
+ }