From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id BDD3F1C01 for ; Wed, 25 Apr 2018 00:10:26 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2018 15:10:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,324,1520924400"; d="scan'208";a="50517304" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by orsmga001.jf.intel.com with ESMTP; 24 Apr 2018 15:10:23 -0700 From: Reshma Pattan To: david.hunt@intel.com, dev@dpdk.org Cc: jananeex.m.parthasarathy@intel.com, Reshma Pattan Date: Tue, 24 Apr 2018 23:10:21 +0100 Message-Id: <1524607821-19809-1-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] app/test: fix shared library build failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 22:10:27 -0000 Using private api `guest_channel_host_connect()` will cause shared library build failure. So revert the changes done. Fixes: d550a8cc31 ("app/test: enhance power manager unit tests") Signed-off-by: Jananee Parthasarathy Signed-off-by: Reshma Pattan --- test/test/test_power_kvm_vm.c | 47 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/test/test/test_power_kvm_vm.c b/test/test/test_power_kvm_vm.c index 2ac74912d..bce706ded 100644 --- a/test/test/test_power_kvm_vm.c +++ b/test/test/test_power_kvm_vm.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2010-2014 Intel Corporation + * Copyright(c) 2010-2018 Intel Corporation */ #include @@ -25,17 +25,12 @@ test_power_kvm_vm(void) #define TEST_POWER_VM_LCORE_ID 0U #define TEST_POWER_VM_LCORE_OUT_OF_BOUNDS (RTE_MAX_LCORE+1) #define TEST_POWER_VM_LCORE_INVALID 1U -#define TEMP_POWER_MANAGER_FILE_PATH "/tmp/testpm" - -int guest_channel_host_connect(const char *path, unsigned int lcore_id); static int test_power_kvm_vm(void) { int ret; enum power_management_env env; - char fPath[PATH_MAX]; - FILE *fPtr = NULL; ret = rte_power_set_env(PM_ENV_KVM_VM); if (ret != 0) { @@ -100,31 +95,13 @@ test_power_kvm_vm(void) /* Test initialisation of a valid lcore */ ret = rte_power_init(TEST_POWER_VM_LCORE_ID); if (ret < 0) { - 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; - } + 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; } /* Test initialisation of previously initialised lcore */ @@ -314,18 +291,10 @@ test_power_kvm_vm(void) return -1; } rte_power_unset_env(); - if (fPtr != NULL) { - fclose(fPtr); - remove(fPath); - } return 0; fail_all: rte_power_exit(TEST_POWER_VM_LCORE_ID); rte_power_unset_env(); - if (fPtr != NULL) { - fclose(fPtr); - remove(fPath); - } return -1; } #endif -- 2.14.3