Commit 2f7a268b authored by intrigeri's avatar intrigeri
Browse files

Merge branch 'stable' into test/8001-8002-pidgin-xmp-otr

parents 22e34639 c53e8afe
......@@ -3,6 +3,7 @@
set -e
CUSTOM_INITSCRIPTS="
tails-autotest-remote-shell
tails-detect-virtualization
tails-kexec
tails-reconfigure-kexec
......
#! /bin/sh
### BEGIN INIT INFO
# Provides: tails-autotest-remote-shell
# Required-Start: mountkernfs $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# X-Start-Before: $x-display-manager gdm gdm3
# Short-Description: Remote shell (over serial link) used in Tails test suite
# Description: Remote shell (over serial link) used in Tails test suite
### END INIT INFO
# Author: Tails Developers <tails@boum.org>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
DESC="Remote shell (over serial link) used in Tails test suite"
NAME="tails-autotest-remote-shell"
SCRIPTNAME="/etc/init.d/${NAME}"
DAEMON="/usr/local/lib/${NAME}"
DAEMON_ARGS="/dev/ttyS0"
# Exit if not run by Tails automated test suite. The if-construction
# below may seem silly but we really want to only continue running
# this script this if the expected kernel command-line option is
# present. Fail safe, not open, and all that.
if grep -qw "autotest_never_use_this_option" /proc/cmdline
then
:
else
exit 0
fi
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
wait_until_remote_shell_is_listening()
{
REMOTE_SHELL_STATE_FILE=/var/lib/live/autotest-remote-shell-running
until [ -e "${REMOTE_SHELL_STATE_FILE}" ]; do
sleep 1
done
}
do_start()
{
start-stop-daemon \
--start \
--quiet \
--background \
--exec ${DAEMON} -- ${DAEMON_ARGS}
wait_until_remote_shell_is_listening
}
case "${1}" in
start)
[ "${VERBOSE}" != no ] && log_daemon_msg "${DESC}" "${NAME}"
do_start
[ "${VERBOSE}" != no ] && log_end_msg ${?}
;;
restart|reload|stop|force-reload)
:
;;
*)
echo "Usage: ${SCRIPTNAME} start" >&2
exit 1
;;
esac
:
#!/bin/sh
SCRIPT=/usr/local/sbin/autotest_remote_shell.py
if grep -qw "autotest_never_use_this_option" /proc/cmdline; then
# FIXME: more beautiful solution
sed -i 's/^exit.*$//' /etc/rc.local
echo "( while true ; do python ${SCRIPT} /dev/ttyS0 ; done ) &" >> \
/etc/rc.local
echo "exit 0" >> /etc/rc.local
fi
......@@ -41,6 +41,12 @@ def main():
dev = argv[1]
port = serial.Serial(port = dev, baudrate = 4000000)
port.open()
# Create a state file so other applications can know that the remote
# shell is operational.
state_file_path = "/var/lib/live/autotest-remote-shell-running"
open(state_file_path, "w").close()
while True:
try:
line = port.readline()
......
......@@ -103,6 +103,15 @@ Requirements on the guest (the remote shell server):
firewall exceptions; actually we don't want any network traffic at
all from it, but this kind of follows from the previous requirement
any way)
* must start before Tails Greeter. Since that's the first point of
user interaction in a Tails system (if we ignore the boot menu), it
seems like a good place to be able to assume that the remote shell
is running.
Scripts:
* [[!tails_gitweb config/chroot_local-includes/usr/local/lib/tails-autotest-remote-shell]]
* [[!tails_gitweb config/chroot_local-includes/etc/init.d/tails-autotest-remote-shell]]
# The art of writing new product test cases
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment