summaryrefslogtreecommitdiff
path: root/utilities/ovs-sim.in
diff options
context:
space:
mode:
Diffstat (limited to 'utilities/ovs-sim.in')
-rwxr-xr-xutilities/ovs-sim.in202
1 files changed, 101 insertions, 101 deletions
diff --git a/utilities/ovs-sim.in b/utilities/ovs-sim.in
index 24c1da0a9..72436c089 100755
--- a/utilities/ovs-sim.in
+++ b/utilities/ovs-sim.in
@@ -241,82 +241,82 @@ ovn_start_db() {
local schema_name=$(ovsdb-tool schema-name $schema)
case $model in
- standalone | backup) ;;
- clustered)
- case $servers in
- [1-9] | [1-9][0-9]) ;;
- *) echo "${db}db servers must be between 1 and 99" >&2
- exit 1
- ;;
- esac
- ;;
- *)
- echo "unknown ${db}db model \"$model\"" >&2
- exit 1
- ;;
+ standalone | backup) ;;
+ clustered)
+ case $servers in
+ [1-9] | [1-9][0-9]) ;;
+ *) echo "${db}db servers must be between 1 and 99" >&2
+ exit 1
+ ;;
+ esac
+ ;;
+ *)
+ echo "unknown ${db}db model \"$model\"" >&2
+ exit 1
+ ;;
esac
ovn_start_ovsdb_server() {
- local i=$1; shift
- as ${db}$i ovsdb-server --detach --no-chdir --pidfile=$db.pid \
- -vsyslog:off -vconsole:off --log-file="$sim_base"/$db$i/$db.log \
- --remote=db:$schema_name,${DB}_Global,connections \
- --private-key=db:$schema_name,SSL,private_key \
- --certificate=db:$schema_name,SSL,certificate \
- --ca-cert=db:$schema_name,SSL,ca_cert \
- --ssl-protocols=db:$schema_name,SSL,ssl_protocols \
- --ssl-ciphers=db:$schema_name,SSL,ssl_ciphers \
- --unixctl=${db} --remote=punix:$db.ovsdb \
- "$sim_base"/$db$i/$db.db "$@"
+ local i=$1; shift
+ as ${db}$i ovsdb-server --detach --no-chdir --pidfile=$db.pid \
+ -vsyslog:off -vconsole:off --log-file="$sim_base"/$db$i/$db.log \
+ --remote=db:$schema_name,${DB}_Global,connections \
+ --private-key=db:$schema_name,SSL,private_key \
+ --certificate=db:$schema_name,SSL,certificate \
+ --ca-cert=db:$schema_name,SSL,ca_cert \
+ --ssl-protocols=db:$schema_name,SSL,ssl_protocols \
+ --ssl-ciphers=db:$schema_name,SSL,ssl_ciphers \
+ --unixctl=${db} --remote=punix:$db.ovsdb \
+ "$sim_base"/$db$i/$db.db "$@"
}
ovn_prep_db() {
- local i=$1
- mkdir "$sim_base"/${db}$i
- touch "$sim_base"/${db}$i/.$db.db.~lock~
+ local i=$1
+ mkdir "$sim_base"/${db}$i
+ touch "$sim_base"/${db}$i/.$db.db.~lock~
}
local n_remotes=1
case $model in
- standalone)
- ovn_prep_db 1
- ovsdb-tool create "$sim_base"/${db}1/$db.db "$schema"
- ovn_start_ovsdb_server 1
- ;;
- backup)
- for i in 1 2; do
- ovn_prep_db $i
- ovsdb-tool create "$sim_base"/$db$i/$db.db "$schema"
- done
- ovn_start_ovsdb_server 1
- ovn_start_ovsdb_server 2 --sync-from=unix:"$sim_base"/${db}1/$db.ovsdb
- cat <<EOF
+ standalone)
+ ovn_prep_db 1
+ ovsdb-tool create "$sim_base"/${db}1/$db.db "$schema"
+ ovn_start_ovsdb_server 1
+ ;;
+ backup)
+ for i in 1 2; do
+ ovn_prep_db $i
+ ovsdb-tool create "$sim_base"/$db$i/$db.db "$schema"
+ done
+ ovn_start_ovsdb_server 1
+ ovn_start_ovsdb_server 2 --sync-from=unix:"$sim_base"/${db}1/$db.ovsdb
+ cat <<EOF
The backup server of OVN $DB can be accessed by:
* ovn-${db}ctl --db=unix:$sim_base/${db}2/$db.ovsdb
* ovs-appctl -t $sim_base/${db}2/${db}
The backup database file is $sim_base/${db}2/$db.db
EOF
- ;;
- clustered)
- n_remotes=$servers
- for i in $(seq $servers); do
- ovn_prep_db $i
- if test $i = 1; then
- ovsdb-tool create-cluster "$sim_base"/$db$i/$db.db "$schema" unix:"$sim_base"/$db$i/db.raft
- else
- ovsdb-tool join-cluster "$sim_base"/$db$i/$db.db $schema_name unix:"$sim_base"/$db$i/db.raft unix:"$sim_base"/${db}1/db.raft
- fi
- ovn_start_ovsdb_server $i
- done
- for i in $(seq $servers); do
- ovsdb-client wait unix:"$sim_base"/${db}$i/$db.ovsdb $schema_name connected
- done
- ;;
+ ;;
+ clustered)
+ n_remotes=$servers
+ for i in $(seq $servers); do
+ ovn_prep_db $i
+ if test $i = 1; then
+ ovsdb-tool create-cluster "$sim_base"/$db$i/$db.db "$schema" unix:"$sim_base"/$db$i/db.raft
+ else
+ ovsdb-tool join-cluster "$sim_base"/$db$i/$db.db $schema_name unix:"$sim_base"/$db$i/db.raft unix:"$sim_base"/${db}1/db.raft
+ fi
+ ovn_start_ovsdb_server $i
+ done
+ for i in $(seq $servers); do
+ ovsdb-client wait unix:"$sim_base"/${db}$i/$db.ovsdb $schema_name connected
+ done
+ ;;
esac
remote=unix:"$sim_base"/${db}1/$db.ovsdb
for i in `seq 2 $n_remotes`; do
- remote=$remote,unix:"$sim_base"/${db}$i/$db.ovsdb
+ remote=$remote,unix:"$sim_base"/${db}$i/$db.ovsdb
done
eval OVN_${DB}_DB=\$remote
eval export OVN_${DB}_DB
@@ -330,30 +330,30 @@ ovn_start() {
local sbdb_servers=3
local prev=
for option; do
- # This option-parsing mechanism borrowed from a Autoconf-generated
- # configure script under the following license:
+ # This option-parsing mechanism borrowed from a Autoconf-generated
+ # configure script under the following license:
- # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
- # 2002, 2003, 2004, 2005, 2006, 2009, 2013 Free Software Foundation, Inc.
- # This configure script is free software; the Free Software Foundation
- # gives unlimited permission to copy, distribute and modify it.
+ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+ # 2002, 2003, 2004, 2005, 2006, 2009, 2013 Free Software Foundation, Inc.
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
eval $prev=\$option
prev=
continue
- fi
- case $option in
+ fi
+ case $option in
*=*) optarg=`expr "X$option" : '[^=]*=\(.*\)'` ;;
*) optarg=yes ;;
- esac
+ esac
- case $dashdash$option in
+ case $dashdash$option in
--)
- dashdash=yes ;;
+ dashdash=yes ;;
-h|--help)
- cat <<EOF
+ cat <<EOF
$FUNCNAME: start OVN central databases and daemons
usage: $FUNCNAME [OPTION...]
@@ -368,47 +368,47 @@ Options:
--sbdb-servers=N number of servers in sbdb cluster (default: 3)
-h, --help Print this usage message.
EOF
- return
- ;;
+ return
+ ;;
--nbdb-s*=*)
- nbdb_servers=$optarg
- nbdb_model=clustered
- ;;
+ nbdb_servers=$optarg
+ nbdb_model=clustered
+ ;;
--nbdb-s*)
- prev=nbdb_servers
- nbdb_model=clustered
- ;;
+ prev=nbdb_servers
+ nbdb_model=clustered
+ ;;
--nbdb-m*=*)
- nbdb_model=$optarg
- ;;
+ nbdb_model=$optarg
+ ;;
--nbdb-m*)
- prev=nbdb_model
- ;;
+ prev=nbdb_model
+ ;;
--sbdb-s*=*)
- sbdb_servers=$optarg
- sbdb_model=clustered
- ;;
+ sbdb_servers=$optarg
+ sbdb_model=clustered
+ ;;
--sbdb-s*)
- prev=sbdb_servers
- sbdb_model=clustered
- ;;
+ prev=sbdb_servers
+ sbdb_model=clustered
+ ;;
--sbdb-m*=*)
- sbdb_model=$optarg
- ;;
+ sbdb_model=$optarg
+ ;;
--sbdb-m*)
- prev=sbdb_model
- ;;
+ prev=sbdb_model
+ ;;
-*)
- echo "unrecognized option $option (use --help for help)" >&2
- return 1
- ;;
+ echo "unrecognized option $option (use --help for help)" >&2
+ return 1
+ ;;
*)
- echo "$option: non-option arguments not supported (use --help for help)" >&2
- return 1
- ;;
- esac
- shift
+ echo "$option: non-option arguments not supported (use --help for help)" >&2
+ return 1
+ ;;
+ esac
+ shift
done
if test -d ovn-sb || test -d ovn-nb; then