Browse Source

update test init script

Waldemar Brodkorb 11 years ago
parent
commit
0719335f07

+ 1 - 1
package/adk-test-tools/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		adk-test-tools
 PKG_VERSION:=		0.1
-PKG_RELEASE:=		6
+PKG_RELEASE:=		7
 PKG_DESCR:=		helper tools and scripts for adk-test-framework
 PKG_SECTION:=		misc
 PKG_URL:=		http://openadk.org/

+ 30 - 15
package/adk-test-tools/files/test.init

@@ -1,18 +1,33 @@
 #!/bin/sh
 #PKG adk-test-tools
 #INIT 90
-[[ $1 = autostart ]] || exit 0
-echo "Setting time via network ..."
-rdate -nv pool.ntp.org
-echo "Starting test script ..."
-grep shell /proc/cmdline > /dev/null 2&>1
-if [ $? -eq 0 ];then
-	exit 0
-fi
-if [ -x /run.sh ];then
-	/run.sh
-	quit
-else
-	echo "no run.sh found"
-	quit
-fi
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+	test x"${test:-NO}" = x"NO" && exit 0
+	exec sh $0 start
+	;;
+start)
+	echo "Setting time via network ..."
+	rdate -nv pool.ntp.org
+	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 $?

+ 1 - 0
package/rdate/files/rdate.postinst

@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
 . $IPKG_INSTROOT/etc/functions.sh
 add_rcconf 'e.g. "-nv pool.ntp.org"' rdate_flags
+add_service ntp 123/tcp
 add_service ntp 123/udp

+ 1 - 0
target/packages/pkg-available/test

@@ -12,6 +12,7 @@ config ADK_PKG_TEST
 	select ADK_SIMPLE_NETWORK_CONFIG
 	select ADK_KPACKAGE_KMOD_IPV6
 	select ADK_TARGET_PACKAGE_TXZ
+	select ADK_RUNTIME_START_ADK_TEST_TOOLS
 	default n
 	help
 	  Package collection used to build adk-test-framework root