code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh -x
set -e
# Get the directory paths (grandparent)
pushd ../..
SRC=${PWD}
BUILD_DIR=${SRC}/build
if [ ! -d $BUILD_DIR ]
then
mkdir -p $BUILD_DIR
fi
popd
# Cache the prepared dapper userspace. Runs once.
dapperext3=$BUILD_DIR/dapper-i386.ext3
if [ ! -e $dapperext3 ]
then
./debootstrap-dapper-i386.sh
fi... | Shell |
#!/bin/sh -x
# Run the zumastor distribution and arch ext3 image using UML COW verify that it works.
# The template should be left unmodified.
# Any parameters are copied to the destination instance and executed as root
# DIST and ARCH default to dapper/i386. but may be specified. Currently
# only DIST=etch, ARCH=i38... | Shell |
#!/bin/sh
#
# $Id: tunbr-config 1004 2007-11-30 16:05:47Z drake.diedrich $
#
# Source /etc/default/testenv for the VIRT* variables, and output
# appropriate compiler flags to build a locally customized tunbr
# for the network and interface bridge specified.
if [ -x /etc/default/testenv ]
then
. /etc/default/testenv
... | Shell |
#!/bin/sh
#
# $Id$
#
# Source /etc/default/testenv for the VIRT* variables, and output
# appropriate compiler flags to build a locally customized tunbr
# for the network and interface bridge specified.
if [ -x /etc/default/testenv ]
then
. /etc/default/testenv
fi
if [ "x$VIRTNET" != "x" ]
then
echo $VIRTNET | \
... | Shell |
#!/bin/bash
for vol in $(ls /var/run/zumastor/cron) ; do
zumastor snapshot $vol daily
done
| Shell |
#!/bin/bash
for vol in $(ls /var/run/zumastor/cron) ; do
zumastor snapshot $vol daily
done
| Shell |
#!/bin/bash
for vol in $(ls /var/run/zumastor/cron) ; do
zumastor snapshot $vol hourly
done
| Shell |
#!/bin/bash
for vol in $(ls /var/run/zumastor/cron) ; do
zumastor snapshot $vol hourly
done
| Shell |
#!/bin/bash
for vol in $(ls /var/run/zumastor/cron) ; do
zumastor snapshot $vol weekly
done
| Shell |
#!/bin/bash
for vol in $(ls /var/run/zumastor/cron) ; do
zumastor snapshot $vol weekly
done
| Shell |
#!/bin/bash
# Zumastor Linux Storage Server
# Copyright (c) 2006 Google Inc.
# Author: Daniel Phillips <phillips@google.com>
# Licensed under the GNU GPL version 2
### BEGIN INIT INFO
# Provides: zumastor
# Required-Start: $network
# Required-Stop: $network
# Should-Start: lvm $named
# should-Sto... | Shell |
#!/bin/bash
# Zumastor Linux Storage Server
# Copyright (c) 2006 Google Inc.
# Author: Daniel Phillips <phillips@google.com>
# Licensed under the GNU GPL version 2
### BEGIN INIT INFO
# Provides: zumastor
# Required-Start: $network
# Required-Stop: $network
# Should-Start: lvm $named
# should-Sto... | Shell |
#!/bin/sh
rm /bin/zumastor
rm -r /lib/zumastor
rm -r /var/lib/zumastor
rm -r /var/run/zumastor
rm -r /var/log/zumastor
rm /etc/cron.hourly/zumastor
rm /etc/cron.daily/zumastor
rm /etc/cron.weekly/zumastor
rm /etc/init.d/zumastor
rm -r /etc/zumastor
| Shell |
#!/bin/sh
[ -z "$DESTDIR" ] && DESTDIR=/
rm ${DESTDIR}/lib/zumastor >/dev/null 2>&1 # in case of symlink
rm ${DESTDIR}/var/lib/zumastor >/dev/null 2>&1 # in case of symlink
rm ${DESTDIR}/var/run/zumastor >/dev/null 2>&1 # in case of symlink
rm ${DESTDIR}/etc/zumastor >/dev/null 2>&1 # in case of symlink
echo ${DESTD... | Shell |
#!/bin/bash
. /lib/zumastor/common
clear
while true; do
clear
for vol in $(ls $VOLUMES 2>/dev/null); do
echo Volume $vol:
sock=$SERVERS/$vol
size=$(ddsnap status $sock --size) || exit 1
size=$(($size*512))
for host in $(ls $VOLUMES/$vol/targets 2>/dev/null); do
echo " Target: $host"
sendfile=$VOLUMES/$vol/t... | Shell |
#!/bin/sh
rm /bin/zumastor
rm -r /lib/zumastor
rm -r /var/lib/zumastor
rm -r /var/run/zumastor
rm -r /var/log/zumastor
rm /etc/cron.hourly/zumastor
rm /etc/cron.daily/zumastor
rm /etc/cron.weekly/zumastor
rm /etc/init.d/zumastor
rm -r /etc/zumastor
| Shell |
#!/bin/sh
ln -s $(pwd)/bin/zumastor /bin/zumastor
ln -s $(pwd)/lib/zumastor /lib/zumastor
ln -s $(pwd)/var/lib/zumastor /var/lib/zumastor
ln -s $(pwd)/var/run/zumastor /var/run/zumastor
ln -s $(pwd)/var/log/zumastor /var/log/zumastor
ln -s $(pwd)/etc/cron.hourly/zumastor /etc/cron.hourly/zumastor
ln -s $(pwd)/etc/cro... | Shell |
#!/bin/sh
[ -z "$DESTDIR" ] && DESTDIR=/
rm ${DESTDIR}/lib/zumastor >/dev/null 2>&1 # in case of symlink
rm ${DESTDIR}/var/lib/zumastor >/dev/null 2>&1 # in case of symlink
rm ${DESTDIR}/var/run/zumastor >/dev/null 2>&1 # in case of symlink
rm ${DESTDIR}/etc/zumastor >/dev/null 2>&1 # in case of symlink
echo ${DESTD... | Shell |
#!/bin/bash
. /lib/zumastor/common
clear
while true; do
clear
for vol in $(ls $VOLUMES 2>/dev/null); do
echo Volume $vol:
sock=$SERVERS/$vol
size=$(ddsnap status $sock --size) || exit 1
size=$(($size*512))
for host in $(ls $VOLUMES/$vol/targets 2>/dev/null); do
echo " Target: $host"
sendfile=$VOLUMES/$vol/t... | Shell |
#!/bin/sh
ln -s $(pwd)/bin/zumastor /bin/zumastor
ln -s $(pwd)/lib/zumastor /lib/zumastor
ln -s $(pwd)/var/lib/zumastor /var/lib/zumastor
ln -s $(pwd)/var/run/zumastor /var/run/zumastor
ln -s $(pwd)/var/log/zumastor /var/log/zumastor
ln -s $(pwd)/etc/cron.hourly/zumastor /etc/cron.hourly/zumastor
ln -s $(pwd)/etc/cro... | Shell |
#!/bin/bash
# Zumastor Linux Storage Server
# Copyright (c) 2006 Google Inc.
# Author: Daniel Phillips <phillips@google.com>
# Licensed under the GNU GPL version 2
### BEGIN INIT INFO
# Provides: zumastor
# Required-Start: $network
# Required-Stop: $network
# Should-Start: lvm $named
# should-Sto... | Shell |
#!/bin/sh
if [ "$1" = "purge" ] ; then
rm -rf /var/lib/zumastor
fi
| Shell |
#!/bin/sh
if [ "$1" = "purge" ] ; then
rm -rf /var/lib/zumastor
fi
| Shell |
#!/bin/bash
# Zumastor Linux Storage Server
# Copyright (c) 2006 Google Inc.
# Author: Daniel Phillips <phillips@google.com>
# Licensed under the GNU GPL version 2
declare -r VOLUMES=/var/lib/zumastor/volumes
declare -r RUNPATH=/var/run/zumastor
declare -r LOGS=/var/log/zumastor
declare -r RUNFILE=$RUNPATH/running
dec... | Shell |
#!/bin/bash
# Zumastor Linux Storage Server
# Copyright (c) 2006 Google Inc.
# Author: Daniel Phillips <phillips@google.com>
# Licensed under the GNU GPL version 2
declare -r VOLUMES=/var/lib/zumastor/volumes
declare -r RUNPATH=/var/run/zumastor
declare -r LOGS=/var/log/zumastor
declare -r RUNFILE=$RUNPATH/running
dec... | Shell |
#!/bin/bash -x
#
# $Id$
#
# based on build_packages.sh
# builds whatever is in current working directory,
# does not pull any external source
# may be run inside an isolated virtual machine for safe automatic builds
#
# Copyright 2007 Google Inc. All rights reserved.
# Author: Drake Diedrich (dld@google.com)
echo "$0 ... | Shell |
#!/bin/sh -x
#
# $Id$
#
# Install build dependencies if they are missing on the qemu build machine
apt-get update
# I wish these worked
pushd zumastor
apt-get build-dep zumastor
popd
pushd ddsnap
apt-get build-dep ddsnap
popd
# manually install all build dependencies, including kernel build
aptitude -y install \
... | Shell |
#!/bin/bash
# zumastor automated build script
# Shapor Naghibzadeh <shapor@google.com>
KERNEL_VERSION=2.6.21.1
BUILD_DIR=build # relative to current directory
LOG=/dev/null
TIME=`date +%s`
[[ -e $1 ]] || { echo "Usage: $0 <path_to_kernel_config> [revision]"; exit 1; }
[[ $# -eq 2 ]] && REV="-r $2"
mkdir $BUILD_DIR ... | Shell |
#!/bin/bash
tmp=/tmp/$$
ver=$1
kpath=$2
[[ -z $ver ]] && { echo "usage: $0 <kernelversion> <pathintree>"; exit 1; }
[[ -d kernel ]] || { echo "no kernel dir"; exit 1; }
[[ -d patches/$ver ]] || { echo "no patches/$ver dir"; exit 1; }
mkdir $tmp || { echo "tmpdir $tmp already exists"; exit 1; }
mkdir $tmp/linux-$ver.or... | Shell |
#!/bin/bash
pushd patches >/dev/null
vers=$(echo *)
popd >/dev/null
for ver in $vers
do
./scripts/genpatch.sh $ver drivers/md > patches/$ver/AUTO.ddsnap.files.patch
done
| Shell |
#!/bin/bash
tmp=/tmp/$$
ver=$1
kpath=$2
[[ -z $ver ]] && { echo "usage: $0 <kernelversion> <pathintree>"; exit 1; }
[[ -d kernel ]] || { echo "no kernel dir"; exit 1; }
[[ -d patches/$ver ]] || { echo "no patches/$ver dir"; exit 1; }
mkdir $tmp || { echo "tmpdir $tmp already exists"; exit 1; }
mkdir $tmp/linux-$ver.or... | Shell |
#!/bin/bash
pushd patches >/dev/null
vers=$(echo *)
popd >/dev/null
for ver in $vers
do
./scripts/genpatch.sh $ver drivers/md > patches/$ver/AUTO.ddsnap.files.patch
done
| Shell |
#!/bin/bash
# zumastor automated build script
# Shapor Naghibzadeh <shapor@google.com>
KERNEL_VERSION=2.6.21.1
BUILD_DIR=build # relative to current directory
LOG=/dev/null
TIME=`date +%s`
[[ -e $1 ]] || { echo "Usage: $0 <path_to_kernel_config> [revision]"; exit 1; }
[[ $# -eq 2 ]] && REV="-r $2"
mkdir $BUILD_DIR ... | Shell |
#!/bin/sh -x
#
# $Id: builddepends.sh 1004 2007-11-30 16:05:47Z drake.diedrich $
#
# Install build dependencies if they are missing on the qemu build machine
apt-get update
# I wish these worked
pushd zumastor
apt-get build-dep zumastor
popd
pushd ddsnap
apt-get build-dep ddsnap
popd
# manually install all build de... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# shutdown source and target umls
. config_uml
. config_replication
ssh $SSH_OPTS $source_uml_host "zumastor forget volume $vol" >& /dev/null
ssh $SSH_OPTS $target_uml_host "zumastor forget volume $vol" >& /dev/null
./stop_uml.sh ... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# configure uml network
[[ $# -eq 3 ]] || [[ $# -eq 4 ]] || { echo "Usage: $setup_network.sh uml_ip uml_hostname [uml_fs]"; exit 1; }
uml_ip=$1
host_tap_ip=$2
uml_host=$3
uml_fs=$4
echo -n Setting up IP MASQUERADE...
iptables -t n... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# download linux kernel and debian root file system image
. config_uml
# Download a file and checks its checksum
download() {
file=`basename "$1"`
test -f $DOWNLOAD_CACHE/$file || (pushd $DOWNLOAD_CACHE; wget -c "$1"; popd)
if ... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# build kernel linux uml with the KERNEL_VERSION specified in config_uml and with ddsnap kerenel patches
. config_uml
pushd $WORKDIR
[[ -e linux-${KERNEL_VERSION} ]] && rm -rf linux-${KERNEL_VERSION}
echo -n Unpacking kernel...
tar... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# This test is based on the failure injection scripts from Joel Votaw <jvotaw@google.com>
# It untars a series of kernel tarball, at the same time,
# simulates processes crashing and sysadmin mistakes at an accelerated rate
. confi... | Shell |
#!/bin/sh
# Demostrates how to run all UML-based Zumastor tests
set -e
set -x
# utilities to build debian packages and run uml
dpkg -s build-essential devscripts fakeroot debhelper > /dev/null 2>&1 || sudo apt-get install build-essential devscripts fakeroot debhelper
dpkg -s uml-utilities > /dev/null 2>&1 || sudo apt-... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# update zumastor and ddsnap
. config_uml
[[ $# -eq 1 ]] || { echo "Usage: update_zuma.sh uml_fs"; exit 1; }
uml_fs=$1
echo -n Upgrading ddsnap and zumastor...
mount -o loop $WORKDIR/$uml_fs /mnt || exit 1
pushd $ZUMA_REPOSITORY/... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# keep running full volume replication between source and target
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start full-volume replication test...
ssh $SSH_OPTS $source_uml_hos... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# install all the required libraries and utilities based on the image downloaded from uml website
umount_exit() {
echo $1
umount /mnt
rm -f $uml_fs
exit 1
}
[[ $# -eq 1 ]] || { echo "Usage: build_fs.sh uml_fs"; exit 1; }
uml_f... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test correctness when 'ddsnap agent' dies
. config_uml
. config_single
# load up uml
./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host || { echo UNRESOLVED; exit 1; }
echo -n Setting up volume...
ssh $SSH_OPTS $uml_host "zum... | Shell |
#!/bin/bash
# Example of how to start one UML instance (if needed) and log into it
# (or run a command remotely)
. ./config_uml
. ./config_single
ps augxw | grep linux | grep -q -v grep || ./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host
set -ex
ssh $SSH_OPTS $uml_host "$@"
| Shell |
#!/bin/bash
# Example of how to start one UML instance (if needed) and copy a single file from it
. ./config_uml
. ./config_single
ps augxw | grep linux | grep -q -v grep || ./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host
set -ex
scp $SCP_OPTS root@${uml_host}:"$1" .
| Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test zumastor stop on target
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start replication ...
ssh $SSH_OPTS $source_uml_host "zumastor define target $vol $target_uml_host:$t... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# run all tests in the current directory
export ITERATIONS=10 # each test runs ten iterations
for filename in $( find $1 -type f -name 'test_*.sh' | sort )
do
test=`basename $filename .sh`
logfile=log_$test
sh $filename >& log_$... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# build kernel linux uml with the KERNEL_VERSION specified in config_uml and with ddsnap kerenel patches
. config_uml
pushd $WORKDIR
[[ -e linux-${KERNEL_VERSION} ]] && rm -rf linux-${KERNEL_VERSION}
echo -n Unpacking kernel...
tar... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# download linux kernel and debian root file system image
. config_uml
# Download a file and checks its checksum
download() {
file=`basename "$1"`
test -f $DOWNLOAD_CACHE/$file || (pushd $DOWNLOAD_CACHE; wget -c "$1"; popd)
if ... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# update zumastor and ddsnap
. config_uml
[[ $# -eq 1 ]] || { echo "Usage: update_zuma.sh uml_fs"; exit 1; }
uml_fs=$1
echo -n Upgrading ddsnap and zumastor...
mount -o loop $WORKDIR/$uml_fs /mnt || exit 1
pushd $ZUMA_REPOSITORY/... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# load up a uml linux
. config_uml
[[ $# -eq 4 ]] || { echo "Usage: start_uml.sh uml_fs ubd_dev ubc_dev uml_host"; exit 1; }
uml_fs=$1
ubdb_dev=$2
ubdc_dev=$3
uml_host=$4
function create_device {
fsize=`stat -c %s $1 2> /dev/nu... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# Unpack the base filesystem image downloaded from uml website,
# setup ssh keys, and build zumastor debian packages
. ./config_uml
[[ $# -eq 1 ]] || { echo "Usage: build_fs.sh uml_fs"; exit 1; }
uml_fs=$1
rm_exit() {
echo $1
... | Shell |
#!/bin/bash
# Example of how to start one UML instance (if needed) and copy a file into it
. ./config_uml
. ./config_single
ps augxw | grep linux | grep -q -v grep || ./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host
set -ex
scp $SCP_OPTS "$@" root@${uml_host}:
| Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# configure uml network
[[ $# -eq 3 ]] || [[ $# -eq 4 ]] || { echo "Usage: $setup_network.sh uml_ip uml_hostname [uml_fs]"; exit 1; }
uml_ip=$1
host_tap_ip=$2
uml_host=$3
uml_fs=$4
echo -n Setting up IP MASQUERADE...
iptables -t n... | Shell |
#!/bin/sh
# Demostrates how to run all UML-based Zumastor tests
set -e
set -x
# utilities to build debian packages and run uml
dpkg -s build-essential devscripts fakeroot debhelper > /dev/null 2>&1 || sudo apt-get install build-essential devscripts fakeroot debhelper
dpkg -s uml-utilities > /dev/null 2>&1 || sudo apt-... | Shell |
#!/bin/sh
dest_dir=/var/run/zumastor/mount/test
number=1
prev=
while true; do
[[ $number -le 5 ]] || number=1
version=2.6.16.$number
wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-${version}.tar.bz2 || continue
[[ ! -z $prev ]] && mv "${dest_dir}"/linux-* "${dest_dir}"/linux-${version}
tar jxf linux-"... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test replication resuming after network goes down and up
# this program requires root previlige
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start replication ...
ssh $SSH_OPT... | Shell |
#!/bin/bash
. config_uml
. config_single
CHUNKSIZE=16k
# test low-level ddsnap creation/deletion
./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host || { echo UNRESOLVED; exit 1; }
echo -n Start ddsnap agent and server...
ssh $SSH_OPTS $uml_host "ddsnap initialize -y -c $CHUNKSIZE /dev/ubdc /dev/ubdb"
ssh $SSH_OP... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test zumastor stop on source
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start replication ...
ssh $SSH_OPTS $source_uml_host "zumastor define target $vol $target_uml_host:$t... | Shell |
#!/bin/bash
# Example of how to shut down the UML instance started by login.sh
. ./config_uml
. ./config_single
set -ex
./stop_uml.sh $uml_host $uml_fs
| Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# Load source and target umls. Set up source and target volumes.
. config_uml
. config_replication
./start_uml.sh $source_uml_fs $source_ubdb_dev $source_ubdc_dev $source_uml_host || exit 1
./start_uml.sh $target_uml_fs $target_ubd... | Shell |
#!/bin/sh
date
case "$(tr -dc 0-9 < /dev/urandom | head -c 1)" in
0)
# Kill a random zumastor-related process
pid_to_kill="$(ps auxwwww | egrep 'ddsnap|zumastor' | grep -v grep | awk '{print $2}' | perl -e '@l=<>; while(@l) { print splice @l, int(rand(@l)), 1 }' | head -1)"
echo "killing process ${pid_to_kill}"
p... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# shutdown a uml and wait for its completion
. config_uml
[[ $# -eq 2 ]] || { echo "Usage: stop_uml.sh uml_host uml_fs"; exit 1; }
uml_host=$1
uml_fs=$2
ssh $SSH_OPTS $uml_host "halt" >& /dev/null || { echo FAIL; exit 1; }
for i ... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# This test is based on the failure injection scripts from Joel Votaw <jvotaw@google.com>
# It untars a series of kernel tarball, at the same time,
# simulates processes crashing and sysadmin mistakes at an accelerated rate
. confi... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# shutdown source and target umls
. config_uml
. config_replication
ssh $SSH_OPTS $source_uml_host "zumastor forget volume $vol" >& /dev/null
ssh $SSH_OPTS $target_uml_host "zumastor forget volume $vol" >& /dev/null
./stop_uml.sh ... | Shell |
#!/bin/bash
# Example of how to start one UML instance (if needed) and copy a file into it
. ./config_uml
. ./config_single
ps augxw | grep linux | grep -q -v grep || ./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host
set -ex
scp $SCP_OPTS "$@" root@${uml_host}:
| Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test replication resuming after network goes down and up
# this program requires root previlige
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start replication ...
ssh $SSH_OPT... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# install all the required libraries and utilities based on the image downloaded from uml website
umount_exit() {
echo $1
umount /mnt
rm -f $uml_fs
exit 1
}
[[ $# -eq 1 ]] || { echo "Usage: build_fs.sh uml_fs"; exit 1; }
uml_f... | Shell |
#!/bin/bash
# Example of how to shut down the UML instance started by login.sh
. ./config_uml
. ./config_single
set -ex
./stop_uml.sh $uml_host $uml_fs
| Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# Unpack the base filesystem image downloaded from uml website,
# setup ssh keys, and build zumastor debian packages
. ./config_uml
[[ $# -eq 1 ]] || { echo "Usage: build_fs.sh uml_fs"; exit 1; }
uml_fs=$1
rm_exit() {
echo $1
... | Shell |
#!/bin/sh
dest_dir=/var/run/zumastor/mount/test
number=1
prev=
while true; do
[[ $number -le 5 ]] || number=1
version=2.6.16.$number
wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-${version}.tar.bz2 || continue
[[ ! -z $prev ]] && mv "${dest_dir}"/linux-* "${dest_dir}"/linux-${version}
tar jxf linux-"... | Shell |
#!/bin/bash
# Example of how to start one UML instance (if needed) and copy a single file from it
. ./config_uml
. ./config_single
ps augxw | grep linux | grep -q -v grep || ./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host
set -ex
scp $SCP_OPTS root@${uml_host}:"$1" .
| Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test correctness when 'ddsnap agent' dies
. config_uml
. config_single
# load up uml
./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host || { echo UNRESOLVED; exit 1; }
echo -n Setting up volume...
ssh $SSH_OPTS $uml_host "zum... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# load up a uml linux
. config_uml
[[ $# -eq 4 ]] || { echo "Usage: start_uml.sh uml_fs ubd_dev ubc_dev uml_host"; exit 1; }
uml_fs=$1
ubdb_dev=$2
ubdc_dev=$3
uml_host=$4
function create_device {
fsize=`stat -c %s $1 2> /dev/nu... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# run all tests in the current directory
export ITERATIONS=10 # each test runs ten iterations
for filename in $( find $1 -type f -name 'test_*.sh' | sort )
do
test=`basename $filename .sh`
logfile=log_$test
sh $filename >& log_$... | Shell |
#!/bin/sh
date
case "$(tr -dc 0-9 < /dev/urandom | head -c 1)" in
0)
# Kill a random zumastor-related process
pid_to_kill="$(ps auxwwww | egrep 'ddsnap|zumastor' | grep -v grep | awk '{print $2}' | perl -e '@l=<>; while(@l) { print splice @l, int(rand(@l)), 1 }' | head -1)"
echo "killing process ${pid_to_kill}"
p... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# shutdown a uml and wait for its completion
. config_uml
[[ $# -eq 2 ]] || { echo "Usage: stop_uml.sh uml_host uml_fs"; exit 1; }
uml_host=$1
uml_fs=$2
ssh $SSH_OPTS $uml_host "halt" >& /dev/null || { echo FAIL; exit 1; }
for i ... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test zumastor stop on source
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start replication ...
ssh $SSH_OPTS $source_uml_host "zumastor define target $vol $target_uml_host:$t... | Shell |
#!/bin/bash
# Example of how to start one UML instance (if needed) and log into it
# (or run a command remotely)
. ./config_uml
. ./config_single
ps augxw | grep linux | grep -q -v grep || ./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host
set -ex
ssh $SSH_OPTS $uml_host "$@"
| Shell |
#!/bin/bash
. config_uml
. config_single
CHUNKSIZE=16k
# test low-level ddsnap creation/deletion
./start_uml.sh $uml_fs $ubdb_dev $ubdc_dev $uml_host || { echo UNRESOLVED; exit 1; }
echo -n Start ddsnap agent and server...
ssh $SSH_OPTS $uml_host "ddsnap initialize -y -c $CHUNKSIZE /dev/ubdc /dev/ubdb"
ssh $SSH_OP... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# test zumastor stop on target
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start replication ...
ssh $SSH_OPTS $source_uml_host "zumastor define target $vol $target_uml_host:$t... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# keep running full volume replication between source and target
. config_uml
. config_replication
./start_replication.sh || { echo UNRESOLVED; exit 1; }
echo -n Start full-volume replication test...
ssh $SSH_OPTS $source_uml_hos... | Shell |
#!/bin/bash
# Copyright 2007 Google Inc.
# Author: Jiaying Zhang <jiayingz@google.com>
# Load source and target umls. Set up source and target volumes.
. config_uml
. config_replication
./start_uml.sh $source_uml_fs $source_ubdb_dev $source_ubdc_dev $source_uml_host || exit 1
./start_uml.sh $target_uml_fs $target_ubd... | Shell |
#!/bin/bash
output_dir=$1
for dir in `ls $output_dir`; do
[[ -d $output_dir/$dir ]] || continue
rm -f $output_dir/$dir.dots
rm -f /tmp/dots
for subdir in `ls $output_dir/$dir`; do
tail -n 1 $output_dir/$dir/$subdir/summary >> /tmp/dots
sort -n /tmp/dots > $output_dir/$dir.dots
done
done
echo set title \"Fst... | Shell |
#!/bin/bash
# example script for comparing nfs performances of nfs-only (without zumastor),
# nfs-zumastor (with zumastor and zero snapshot), and nfs-snapshot (with zumastor and one snapshot)
# please change the testing nfs loads according to the server capacity
LOADS="200 400 600 800 1000"
# type of tests
TESTS="nfs... | Shell |
#!/bin/bash
output_dir=$1
for dir in `ls $output_dir`; do
[[ -d $output_dir/$dir ]] || continue
rm -f $output_dir/$dir.dots
rm -f /tmp/dots
for subdir in `ls $output_dir/$dir`; do
tail -n 1 $output_dir/$dir/$subdir/summary >> /tmp/dots
sort -n /tmp/dots > $output_dir/$dir.dots
done
done
echo set title \"Fst... | Shell |
#!/bin/bash
# example script for comparing nfs performances of nfs-only (without zumastor),
# nfs-zumastor (with zumastor and zero snapshot), and nfs-snapshot (with zumastor and one snapshot)
# please change the testing nfs loads according to the server capacity
LOADS="200 400 600 800 1000"
# type of tests
TESTS="nfs... | Shell |
#!/bin/sh
echo set title \"Time to untar a kernel source tree vs Number of Snapshots\"
echo set xlabel \"Number of Snapshots\"
echo set ylabel \"Real time \(s\) to untar kernel and sync\"
echo set key below
echo set terminal postscript enhanced color
echo set output \"all_tests.ps\"
echo -n "plot "
count=0
for testfil... | Shell |
#!/bin/sh
set -u # let make sure we use initialized variable
AGENT_LOG=/tmp/agent.log
SERVER_LOG=/tmp/server.log
AGENT_PIPE=/tmp/control
SERVER_PIPE=/tmp/server
. ./config.sh
global_test_num=0
setup_tar() {
mkfs.ext3 $TAR_DEV || { echo "unable to mkfs tar device"; exit 1; }
mount_dir $TAR_DEV $TAR_MNT
cp ${SO... | Shell |
#!/bin/sh
set -u # let make sure we use initialized variable
AGENT_LOG=/tmp/agent.log
SERVER_LOG=/tmp/server.log
AGENT_PIPE=/tmp/control
SERVER_PIPE=/tmp/server
. ./config.sh
global_test_num=0
setup_tar() {
mkfs.ext3 $TAR_DEV || { echo "unable to mkfs tar device"; exit 1; }
mount_dir $TAR_DEV $TAR_MNT
cp ${SO... | Shell |
#!/bin/sh
set -u # let make sure we use initialized variable
#setting up system parameters for nsnaps script
#Example:
#VOLUME_NAME= volume you are replicating
#ORIGIN_MOUNT= location of the volume's mount point
#TAR_DEV= tar device
#TAR_MNT= location of where TAR_DEV is mounted
#SOURCE_TAR= kernel source tree
#KERN... | Shell |
#!/bin/sh
echo set title \"Time to untar a kernel source tree vs Number of Snapshots\"
echo set xlabel \"Number of Snapshots\"
echo set ylabel \"Real time \(s\) to untar kernel and sync\"
echo set key below
echo set terminal postscript enhanced color
echo set output \"all_tests.ps\"
echo -n "plot "
count=0
for testfil... | Shell |
#!/bin/sh
set -u # let make sure we use initialized variable
#setting up system parameters for nsnaps script
#Example:
#VOLUME_NAME= volume you are replicating
#ORIGIN_MOUNT= location of the volume's mount point
#TAR_DEV= tar device
#TAR_MNT= location of where TAR_DEV is mounted
#SOURCE_TAR= kernel source tree
#KERN... | Shell |
#!/bin/sh
# Simple benchmark to compare time-to-take-snapshot between
# Zumastor, rsync, and lvm snapshot+rsync.
abort()
{
echo "failed" $1
exec false
echo notreached
}
# Create $ndirs directories,
# each containing $nfiles files,
# each containing $nkB pseudorandom kilobytes
gendata() {
local ndirs=$1... | Shell |
#!/bin/sh -x
#
# multibonnie.sh {processes} {16MB data chunks}
#
# A wrapper around bonnie to launch multiple parallel threads, and to size
# the small and large file data the same. Small files are between 0 and
# 32 KB, with 1000 per directory.
multibonnie() {
N=$1
total=$2
dirs=$(( $total / $N ))
size=$((... | Shell |
#!/bin/sh -x
#
# multibonnie.sh {processes} {16MB data chunks}
#
# A wrapper around bonnie to launch multiple parallel threads, and to size
# the small and large file data the same. Small files are between 0 and
# 32 KB, with 1000 per directory.
multibonnie() {
N=$1
total=$2
dirs=$(( $total / $N ))
size=$((... | Shell |
#!/bin/sh
# Simple benchmark to compare time-to-take-snapshot between
# Zumastor, rsync, and lvm snapshot+rsync.
abort()
{
echo "failed" $1
exec false
echo notreached
}
# Create $ndirs directories,
# each containing $nfiles files,
# each containing $nkB pseudorandom kilobytes
gendata() {
local ndirs=$1... | Shell |
#!/bin/bash -x
#
# $Id: buildcurrent.sh 1700 2008-06-09 22:39:16Z williamanowak $
#
# based on build_packages.sh
# builds whatever is in current working directory,
# does not pull any external source
# may be run inside an isolated virtual machine for safe automatic builds
#
# Copyright 2007 Google Inc. All rights rese... | Shell |
#!/bin/bash -x
#
# $Id: buildcurrentsrc.sh 1611 2008-04-29 21:21:23Z williamanowak $
#
# based on buildcurrent.sh
# builds whatever is in current working directory,
# does not pull any external source
# may be run inside an isolated virtual machine for safe automatic builds
# Only builds deb src packages for upload to ... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.