mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 21:16:57 +02:00
bin: drop some obviously unused scripts
This commit is contained in:
parent
97ab652443
commit
2de95be0ef
@ -1,45 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
|
||||||
# found in the LICENSE file.
|
|
||||||
|
|
||||||
# Returns the version of Chrome running on a remote machine.
|
|
||||||
|
|
||||||
# --- BEGIN COMMON.SH BOILERPLATE ---
|
|
||||||
# Load common CrOS utilities. Inside the chroot this file is installed in
|
|
||||||
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
|
|
||||||
# location.
|
|
||||||
find_common_sh() {
|
|
||||||
local common_paths=("$(dirname "$(readlink -f "$0")")/.." /usr/lib/crosutils)
|
|
||||||
local path
|
|
||||||
|
|
||||||
SCRIPT_ROOT="${common_paths[0]}"
|
|
||||||
for path in "${common_paths[@]}"; do
|
|
||||||
if [ -r "${path}/common.sh" ]; then
|
|
||||||
SCRIPT_ROOT="${path}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
find_common_sh
|
|
||||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
|
||||||
# --- END COMMON.SH BOILERPLATE ---
|
|
||||||
|
|
||||||
. "${SCRIPT_ROOT}/remote_access.sh" || exit 1
|
|
||||||
|
|
||||||
FLAGS "$@" || exit 1
|
|
||||||
|
|
||||||
switch_to_strict_mode
|
|
||||||
|
|
||||||
# TMP necessary for remote_access_init.
|
|
||||||
TMP=$(mktemp -d /tmp/cros_check_chrome_version.XXXX)
|
|
||||||
trap "rm -rf ${TMP}" EXIT
|
|
||||||
|
|
||||||
remote_access_init &> /dev/null
|
|
||||||
|
|
||||||
remote_sh "/opt/google/chrome/chrome --version"
|
|
||||||
CHROME_VERSION=$(echo ${REMOTE_OUT} | \
|
|
||||||
sed 's/.* \([0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\).*/\1/')
|
|
||||||
echo "${CHROME_VERSION}"
|
|
@ -1,114 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
|
||||||
# found in the LICENSE file.
|
|
||||||
|
|
||||||
# Script to update a running device with an optionally built package out
|
|
||||||
# of your build directory
|
|
||||||
|
|
||||||
# --- BEGIN COMMON.SH BOILERPLATE ---
|
|
||||||
# Load common CrOS utilities. Inside the chroot this file is installed in
|
|
||||||
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
|
|
||||||
# location.
|
|
||||||
find_common_sh() {
|
|
||||||
local common_paths=("$(dirname "$(readlink -f "$0")")/.." /usr/lib/crosutils)
|
|
||||||
local path
|
|
||||||
|
|
||||||
SCRIPT_ROOT="${common_paths[0]}"
|
|
||||||
for path in "${common_paths[@]}"; do
|
|
||||||
if [ -r "${path}/common.sh" ]; then
|
|
||||||
SCRIPT_ROOT="${path}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
find_common_sh
|
|
||||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
|
||||||
# --- END COMMON.SH BOILERPLATE ---
|
|
||||||
|
|
||||||
. "${SCRIPT_ROOT}/remote_access.sh" || exit 1
|
|
||||||
|
|
||||||
DEFINE_boolean verbose ${FLAGS_FALSE} \
|
|
||||||
"Whether to output verbose information for debugging."
|
|
||||||
DEFINE_boolean build ${FLAGS_FALSE} "Build package before installing"
|
|
||||||
DEFINE_string board "$DEFAULT_BOARD" \
|
|
||||||
"Board for which the package should be built/found"
|
|
||||||
|
|
||||||
FLAGS "$@" || exit 1
|
|
||||||
|
|
||||||
TMP=$(mktemp -d /tmp/cros_package_to_live.XXXX)
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
if [ "${root_mount_type}" = ro ]; then
|
|
||||||
remote_sh "mount -o remount,ro /" || /bin/true
|
|
||||||
fi
|
|
||||||
if [ "${var_mount_noexec}" = yes ]; then
|
|
||||||
remote_sh "mount -o remount,noexec /var" || /bin/true
|
|
||||||
fi
|
|
||||||
cleanup_remote_access
|
|
||||||
rm -rf "${TMP}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make sure we have a package name
|
|
||||||
if [ -z "${FLAGS_ARGV}" ]; then
|
|
||||||
echo "Please specify packages to install. For example:"
|
|
||||||
echo " $0 --remote=MyMachine flimflam"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
remote_access_init
|
|
||||||
learn_board
|
|
||||||
|
|
||||||
if [ -z "${FLAGS_board}" ]; then
|
|
||||||
echo "Please specify a board using the --board=MyBoard argument"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
switch_to_strict_mode
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
eval set -- "${FLAGS_ARGV}"
|
|
||||||
|
|
||||||
if [ ${FLAGS_build} -eq ${FLAGS_TRUE} ]; then
|
|
||||||
emerge-${FLAGS_board} $@
|
|
||||||
fi
|
|
||||||
|
|
||||||
PKGROOT="/build/${FLAGS_board}/packages"
|
|
||||||
|
|
||||||
# Temporarily clear read-only flag on / if it is set
|
|
||||||
remote_sh "grep '\S* / ' /proc/mounts | tail -1 | awk '{ print \$4 }' |
|
|
||||||
cut -d, -f1"
|
|
||||||
root_mount_type=${REMOTE_OUT}
|
|
||||||
if [ "${root_mount_type}" = ro ]; then
|
|
||||||
remote_sh "mount -o remount,rw /"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Temporarily clear noexec flag on /var if it is set
|
|
||||||
remote_sh "grep '\S* /var ' /proc/mounts | tail -1 | awk '{ print \$4 }'"
|
|
||||||
if expr "${REMOTE_OUT}" : '.*noexec' >/dev/null; then
|
|
||||||
var_mount_noexec=yes
|
|
||||||
remote_sh "mount -o remount,exec /var"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for pkg in $@; do
|
|
||||||
latest_pkg=$(ls -tr $PKGROOT/*/${pkg}-[0-9]* | tail -1)
|
|
||||||
if [ -z "${latest_pkg}" ]; then
|
|
||||||
echo "Could not find latest built version of ${pkg}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
pkg_dir=$(basename "$(dirname "$latest_pkg")")
|
|
||||||
pkg_name=$(basename "$latest_pkg")
|
|
||||||
echo "Installing ${latest_pkg}..."
|
|
||||||
|
|
||||||
remote_sh "mktemp -d /tmp/cros_package_to_live.XXXX"
|
|
||||||
temp_dir=$REMOTE_OUT
|
|
||||||
remote_cp_to "${latest_pkg}" "${temp_dir}"
|
|
||||||
remote_sh "mkdir -p /usr/portage/packages/${pkg_dir} &&
|
|
||||||
mv ${temp_dir}/${pkg_name} /usr/portage/packages/${pkg_dir} &&
|
|
||||||
env FEATURES=-sandbox emerge --usepkg \
|
|
||||||
/usr/portage/packages/${pkg_dir}/${pkg_name} 1>&2"
|
|
||||||
echo "${pkg} has been installed"
|
|
||||||
remote_sh "rm -rf ${temp_dir}"
|
|
||||||
done
|
|
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
|
||||||
# found in the LICENSE file.
|
|
||||||
|
|
||||||
# Usage:
|
|
||||||
# revert_image.sh [image_to_revert]
|
|
||||||
#
|
|
||||||
# This assumes the image has been updated by update_image.sh.
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
cat <<EOF
|
|
||||||
|
|
||||||
usage:
|
|
||||||
revert_image.sh [image_to_revert]
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ $# < 1 ]]; then
|
|
||||||
echo "Not enough arguments supplied."
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
IMAGE=$(readlink -f "$1")
|
|
||||||
IMAGE_DIR=$(dirname "$IMAGE")
|
|
||||||
|
|
||||||
if [[ -z "$IMAGE" ]]; then
|
|
||||||
echo "Missing required argument 'image_to_revert'"
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "$IMAGE_DIR"
|
|
||||||
|
|
||||||
if [[ ! -d "./orig_partitions" ]]; then
|
|
||||||
echo "Could not find original partitions."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -f ./orig_partitions/* ./
|
|
||||||
|
|
||||||
./pack_partitions.sh "$IMAGE"
|
|
||||||
rm -rf ./orig_partitions
|
|
@ -1,135 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
|
||||||
# found in the LICENSE file.
|
|
||||||
|
|
||||||
# Wrapper script around run_remote_tests.sh that knows how to find
|
|
||||||
# device test cells.
|
|
||||||
|
|
||||||
# Right now this is mostly a modified copy of cros_run_wifi_tests.sh.
|
|
||||||
|
|
||||||
# --- BEGIN COMMON.SH BOILERPLATE ---
|
|
||||||
# Load common CrOS utilities. Inside the chroot this file is installed in
|
|
||||||
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
|
|
||||||
# location.
|
|
||||||
find_common_sh() {
|
|
||||||
local common_paths=("$(dirname "$(readlink -f "$0")")/.." /usr/lib/crosutils)
|
|
||||||
local path
|
|
||||||
|
|
||||||
SCRIPT_ROOT="${common_paths[0]}"
|
|
||||||
for path in "${common_paths[@]}"; do
|
|
||||||
if [ -r "${path}/common.sh" ]; then
|
|
||||||
SCRIPT_ROOT="${path}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
find_common_sh
|
|
||||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
|
||||||
# --- END COMMON.SH BOILERPLATE ---
|
|
||||||
|
|
||||||
# Figure out the default chromelab server name. In order for this to
|
|
||||||
# work correctly, you have to:
|
|
||||||
#
|
|
||||||
# - Put the hostname into "scripts/.default_cell_test_lab"
|
|
||||||
# - Create an /etc/hosts entry in your chroot for that hostname
|
|
||||||
# (if it isn't findable via DNS)
|
|
||||||
if [ -f "$GCLIENT_ROOT/src/scripts/.default_cell_test_lab" ] ; then
|
|
||||||
DEFAULT_LAB=`cat "$GCLIENT_ROOT/src/scripts/.default_cell_test_lab"`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO(pstew) Since this is a wrapper script, we need to accept all
|
|
||||||
# arguments run_remote_tests does, plus a few more of our own. This
|
|
||||||
# can lead to version skew issues
|
|
||||||
|
|
||||||
DEFINE_string args "" "Command line arguments for test, separated with comma" a
|
|
||||||
DEFINE_string board "" "The board for which you are building autotest"
|
|
||||||
DEFINE_string chroot "" "alternate chroot location" c
|
|
||||||
DEFINE_boolean cleanup ${FLAGS_FALSE} "Clean up temp directory"
|
|
||||||
DEFINE_string iterations "" "Iterations to run every top level test" i
|
|
||||||
DEFINE_string prepackaged_autotest "" "Use this prepackaged autotest dir"
|
|
||||||
DEFINE_string results_dir_root "" "alternate root results directory"
|
|
||||||
DEFINE_string remote "" "IP of device to perform test"
|
|
||||||
DEFINE_boolean verbose ${FLAGS_FALSE} "Show verbose autoserv output" v
|
|
||||||
|
|
||||||
# These flags are specific to run_cell_tests
|
|
||||||
DEFINE_string cell "" "Cell name to perform test on"
|
|
||||||
DEFINE_string lab "${DEFAULT_LAB}" "Lab machine to perform test on"
|
|
||||||
DEFINE_string url "" "URL to lab server config server"
|
|
||||||
|
|
||||||
FLAGS "$@" || exit 1
|
|
||||||
|
|
||||||
run_remote_flags=""
|
|
||||||
run_remote_args=${FLAGS_args}
|
|
||||||
|
|
||||||
append_flag () {
|
|
||||||
local delim=''
|
|
||||||
[ -n "${run_remote_flags}" ] && delim=' '
|
|
||||||
run_remote_flags="${run_remote_flags}${delim}$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
append_arg () {
|
|
||||||
local delim=''
|
|
||||||
[ -n "${run_remote_args}" ] && delim=' '
|
|
||||||
run_remote_args="${run_remote_args}${delim}$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_board}" ]; then
|
|
||||||
append_flag --board "'${FLAGS_board}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_chroot}" ]; then
|
|
||||||
append_flag --chroot "'${FLAGS_chroot}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${FLAGS_cleanup}" -eq ${FLAGS_TRUE} ]; then
|
|
||||||
append_flag --cleanup
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_iterations}" ]; then
|
|
||||||
append_flag --iterations ${FLAGS_iterations}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_prepackaged_autotest}" ]; then
|
|
||||||
append_flag --prepackaged_autotest "'${FLAGS_prepackaged_autotest}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_results_dir_root}" ]; then
|
|
||||||
append_flag --results_dir_root "'${FLAGS_results_dir_root}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${FLAGS_verbose}" -eq ${FLAGS_TRUE} ]; then
|
|
||||||
append_flag --verbose
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_url}" ]; then
|
|
||||||
lab_url=${FLAGS_url}
|
|
||||||
elif [ -n "${FLAGS_lab}" ]; then
|
|
||||||
lab_url="http://${FLAGS_lab}:8080/cells.json"
|
|
||||||
else
|
|
||||||
echo ">>> No lab server specified. Please use --lab or --url options"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -a "${FLAGS_cell}" ]; then
|
|
||||||
echo ">>> No cell specified. Please use --cell option"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO(ttuttle): Somewhere between us and the control file, the list of
|
|
||||||
# arguments is rotated left (so that the first argument ends up at the
|
|
||||||
# end). This is a workaround; the correct order is "0 url cell".
|
|
||||||
|
|
||||||
append_arg "$FLAGS_cell";
|
|
||||||
append_arg "0"
|
|
||||||
append_arg "$lab_url";
|
|
||||||
|
|
||||||
#for arg in "$@"; do
|
|
||||||
# append_arg $arg
|
|
||||||
#done
|
|
||||||
|
|
||||||
eval "exec ${SCRIPTS_DIR}/run_remote_tests.sh \
|
|
||||||
--args=\"${run_remote_args}\" --remote=${FLAGS_remote} $run_remote_flags \
|
|
||||||
$FLAGS_ARGV"
|
|
@ -1 +0,0 @@
|
|||||||
../../platform/crostestutils/utils_py/cros_run_parallel_vm_tests.py
|
|
@ -1,169 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
|
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
|
||||||
# found in the LICENSE file.
|
|
||||||
|
|
||||||
# Wrapper script around run_remote_tests.sh that knows how to find
|
|
||||||
# device test cells.
|
|
||||||
|
|
||||||
# --- BEGIN COMMON.SH BOILERPLATE ---
|
|
||||||
# Load common CrOS utilities. Inside the chroot this file is installed in
|
|
||||||
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
|
|
||||||
# location.
|
|
||||||
find_common_sh() {
|
|
||||||
local common_paths=("$(dirname "$(readlink -f "$0")")/.." /usr/lib/crosutils)
|
|
||||||
local path
|
|
||||||
|
|
||||||
SCRIPT_ROOT="${common_paths[0]}"
|
|
||||||
for path in "${common_paths[@]}"; do
|
|
||||||
if [ -r "${path}/common.sh" ]; then
|
|
||||||
SCRIPT_ROOT="${path}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
find_common_sh
|
|
||||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
|
||||||
# --- END COMMON.SH BOILERPLATE ---
|
|
||||||
|
|
||||||
# Figure out the default chromelab server name. In order for this to
|
|
||||||
# work correctly, you have to:
|
|
||||||
#
|
|
||||||
# - Put the hostname into "scripts/.default_wifi_test_lab"
|
|
||||||
# - Create an /etc/hosts entry in your chroot for that hostname
|
|
||||||
# (if it isn't findable via DNS)
|
|
||||||
# - Make sure you have created a wifi_testbed_${lab} file in the
|
|
||||||
# ${autotest}/files/client/config/ directory
|
|
||||||
if [ -f "$GCLIENT_ROOT/src/scripts/.default_wifi_test_lab" ] ; then
|
|
||||||
DEFAULT_LAB=`cat "$GCLIENT_ROOT/src/scripts/.default_wifi_test_lab"`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# TODO(pstew) Since this is a wrapper script, we need to accept all
|
|
||||||
# arguments run_remote_tests does, plus a few more of our own. This
|
|
||||||
# can lead to version skew issues
|
|
||||||
|
|
||||||
DEFINE_string args "" "Command line arguments for test, separated with comma" a
|
|
||||||
DEFINE_string board "" "The board for which you are building autotest"
|
|
||||||
DEFINE_string chroot "" "alternate chroot location" c
|
|
||||||
DEFINE_boolean cleanup ${FLAGS_FALSE} "Clean up temp directory"
|
|
||||||
DEFINE_string iterations "" "Iterations to run every top level test" i
|
|
||||||
DEFINE_boolean use_emerged ${FLAGS_FALSE} \
|
|
||||||
"Force use of emerged autotest pacakges"
|
|
||||||
DEFINE_string autotest_dir "" "Use this prepackaged autotest dir"
|
|
||||||
DEFINE_string results_dir_root "" "alternate root results directory"
|
|
||||||
DEFINE_boolean verbose ${FLAGS_FALSE} "Show verbose autoserv output" v
|
|
||||||
|
|
||||||
# These flags are specific to run_wifi_tests
|
|
||||||
DEFINE_string cell "" "Cell number to perform test on"
|
|
||||||
DEFINE_string client "" "Host name or IP of device to perform test"
|
|
||||||
DEFINE_string lab "${DEFAULT_LAB}" "Lab machine to perform test on"
|
|
||||||
DEFINE_string url "" "URL to lab server config server"
|
|
||||||
|
|
||||||
FLAGS "$@" || exit 1
|
|
||||||
|
|
||||||
run_remote_flags=""
|
|
||||||
run_remote_args=${FLAGS_args}
|
|
||||||
|
|
||||||
append_flag () {
|
|
||||||
local delim=''
|
|
||||||
[ -n "${run_remote_flags}" ] && delim=' '
|
|
||||||
run_remote_flags="${run_remote_flags}${delim}$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
append_arg () {
|
|
||||||
local delim=''
|
|
||||||
[ -n "${run_remote_args}" ] && delim=' '
|
|
||||||
run_remote_args="${run_remote_args}${delim}$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_board}" ]; then
|
|
||||||
append_flag --board "'${FLAGS_board}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_chroot}" ]; then
|
|
||||||
append_flag --chroot "'${FLAGS_chroot}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${FLAGS_cleanup}" -eq ${FLAGS_TRUE} ]; then
|
|
||||||
append_flag --cleanup
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_iterations}" ]; then
|
|
||||||
append_flag --iterations ${FLAGS_iterations}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${FLAGS_use_emerged}" -eq ${FLAGS_TRUE} ]; then
|
|
||||||
append_flag --use_emerged
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_autotest_dir}" ]; then
|
|
||||||
append_flag --autotest_dir "'${FLAGS_autotest_dir}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_results_dir_root}" ]; then
|
|
||||||
append_flag --results_dir_root "'${FLAGS_results_dir_root}'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${FLAGS_verbose}" -eq ${FLAGS_TRUE} ]; then
|
|
||||||
append_flag --verbose
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Parse our local args
|
|
||||||
if [ -n "${FLAGS_lab}" ] ; then
|
|
||||||
# Add a config file for the lab if one isn't already set
|
|
||||||
if ! expr "${run_remote_args}" : '.*config_file=' >/dev/null; then
|
|
||||||
append_arg "config_file=wifi_testbed_${FLAGS_lab}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${FLAGS_url}" ] ; then
|
|
||||||
lab_url=${FLAGS_url}
|
|
||||||
elif [ -n "${FLAGS_lab}" ] ; then
|
|
||||||
lab_url="http://${FLAGS_lab}:8080/cells"
|
|
||||||
else
|
|
||||||
echo ">>> No lab server specified. Please use --lab or --url options"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cell_no=0
|
|
||||||
|
|
||||||
# Retrieve the testbed config from the server and match either the client
|
|
||||||
# or the cell number to one of the entries
|
|
||||||
ret=$(curl -s $lab_url | \
|
|
||||||
while read line; do
|
|
||||||
# Each line from the server is made up of:
|
|
||||||
# client_name router_name server_name client_addr router_addr server_addr
|
|
||||||
set $line
|
|
||||||
if [ "${FLAGS_cell}" = "$cell_no" -o "${FLAGS_client}" = "$1" -o \
|
|
||||||
"${FLAGS_client}" = "$4" ] ; then
|
|
||||||
if [ "$5" = "0.0.0.0" -o "$4" = "0.0.0.0" ]; then
|
|
||||||
# Error -- these should never be zeroes
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
echo "$4"
|
|
||||||
echo "router_addr=$5"
|
|
||||||
if [ "$6" != "0.0.0.0" ] ; then
|
|
||||||
echo "server_addr=$6"
|
|
||||||
fi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
cell_no=$[cell_no + 1]
|
|
||||||
done)
|
|
||||||
|
|
||||||
if [ -z "$ret" ] ; then
|
|
||||||
echo ">>> Cell or host not found at $lab_url"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set $ret
|
|
||||||
remote=$1
|
|
||||||
shift
|
|
||||||
for arg in "$@"; do
|
|
||||||
append_arg $arg
|
|
||||||
done
|
|
||||||
|
|
||||||
eval "exec ${SCRIPTS_DIR}/run_remote_tests.sh \
|
|
||||||
--args=\"${run_remote_args}\" --remote=${remote} $run_remote_flags \
|
|
||||||
$FLAGS_ARGV"
|
|
Loading…
Reference in New Issue
Block a user