From e12f9f2abbe7054f005c8c28b2eb416c6b0eb086 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 8 Jul 2014 17:27:32 +0200 Subject: fix update-rcconf, rename adk-test package --- package/adktest/Makefile | 28 ++++++++++++++++++++++++++++ package/adktest/files/adktest.init | 32 ++++++++++++++++++++++++++++++++ package/adktest/files/adktest.postinst | 3 +++ package/adktest/src/qmp | 4 ++++ package/adktest/src/quit | 2 ++ 5 files changed, 69 insertions(+) create mode 100644 package/adktest/Makefile create mode 100755 package/adktest/files/adktest.init create mode 100644 package/adktest/files/adktest.postinst create mode 100755 package/adktest/src/qmp create mode 100755 package/adktest/src/quit (limited to 'package/adktest') diff --git a/package/adktest/Makefile b/package/adktest/Makefile new file mode 100644 index 000000000..9a47f7909 --- /dev/null +++ b/package/adktest/Makefile @@ -0,0 +1,28 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= adktest +PKG_VERSION:= 0.1 +PKG_RELEASE:= 7 +PKG_DESCR:= helper tools and scripts for adk-test-framework +PKG_SECTION:= base/misc +PKG_URL:= http://openadk.org/ + +NO_DISTFILES:= 1 + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,ADKTEST,adktest,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +CONFIG_STYLE:= manual +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +adktest-install: + $(INSTALL_DIR) $(IDIR_ADKTEST)/usr/bin + $(INSTALL_BIN) $(WRKBUILD)/{qmp,quit} \ + $(IDIR_ADKTEST)/usr/bin + +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/adktest/files/adktest.init b/package/adktest/files/adktest.init new file mode 100755 index 000000000..ac1a047aa --- /dev/null +++ b/package/adktest/files/adktest.init @@ -0,0 +1,32 @@ +#!/bin/sh +#PKG adktest +#INIT 90 +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${adktest:-NO}" = x"NO" && exit 0 + test x"$adktest" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start + exec sh $0 start + ;; +start) + grep shell /proc/cmdline > /dev/null 2&>1 + if [ $? -eq 0 ];then + exit 0 + fi + echo "Starting test script ..." + if [ -x /run.sh ];then + /run.sh + quit + else + echo "no run.sh found" + quit + fi + ;; +*) + echo "Usage: $0 {start}" + exit 1 + ;; +esac +exit $? diff --git a/package/adktest/files/adktest.postinst b/package/adktest/files/adktest.postinst new file mode 100644 index 000000000..f8c53d562 --- /dev/null +++ b/package/adktest/files/adktest.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf adktest NO diff --git a/package/adktest/src/qmp b/package/adktest/src/qmp new file mode 100755 index 000000000..8f9912222 --- /dev/null +++ b/package/adktest/src/qmp @@ -0,0 +1,4 @@ +#!/bin/sh +echo '{ "execute": "qmp_capabilities" }' +sleep 1 +echo '{ "execute": "quit" }' diff --git a/package/adktest/src/quit b/package/adktest/src/quit new file mode 100755 index 000000000..a625553e2 --- /dev/null +++ b/package/adktest/src/quit @@ -0,0 +1,2 @@ +#!/bin/sh +socat exec:/usr/bin/qmp tcp:10.0.2.2:4444 -- cgit v1.2.3