From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id 9AB8737B1 for ; Fri, 29 Apr 2016 15:13:38 +0200 (CEST) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so1.wedos.net (Postfix) with ESMTPSA id 3qxDfV1htXz8h0; Fri, 29 Apr 2016 15:13:38 +0200 (CEST) From: Jan Viktorin To: dev@dpdk.org Cc: Jan Viktorin , Thomas Monjalon , David Marchand Date: Fri, 29 Apr 2016 15:11:32 +0200 Message-Id: <1461935496-20367-1-git-send-email-viktorin@rehivetech.com> X-Mailer: git-send-email 2.8.0 Subject: [dpdk-dev] [RFC 0/4] Include resources in tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 13:13:38 -0000 Hello, this patch set introduces a mechanism to include a resource (in general a blob) into the test binary. This allows to make tests less dependent on the target testing environment. The first use case is testing of PCI bus scan by changing the hard-coded path (/sys/bus/pci/devices) to something different and provide a fake tree of devices with the test. It can help with testing of device-tree parsing as I've proposed in [1] where such mechanism was missing at that time. I'd like to use such framework for the SoC infra testing as well. The patch set introduces a struct resource into the app/test. The resource is generic to include any kind of binary data. The binary data can be created in C or linked as an object file (created by objcopy). I am not sure where to place the objcopy logic and how to perform guessing of the objcopy arguments as they are pretty non-standard. To include a complex resource (a file hierarchy), the last patch implements an archive extraction logic. So, it is possible to include a tar archive and unpack it before a test starts. Any ideas how to do this in a better way are welcome. [1] http://comments.gmane.org/gmane.comp.networking.dpdk.devel/36545 Regards Jan Viktorin --- Jan Viktorin (4): app/test: introduce resources for tests app/test: support resources externally linked app/test: add functions to create files from resources app/test: support resources archived by tar app/test/Makefile | 38 +++++++ app/test/resource.c | 276 +++++++++++++++++++++++++++++++++++++++++++++++ app/test/resource.h | 99 +++++++++++++++++ app/test/test_resource.c | 132 +++++++++++++++++++++++ 4 files changed, 545 insertions(+) create mode 100644 app/test/resource.c create mode 100644 app/test/resource.h create mode 100644 app/test/test_resource.c -- 2.8.0