Hello community, here is the log from the commit of package booth for openSUSE:Factory checked in at 2015-12-09 19:50:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/booth (Old) and /work/SRC/openSUSE:Factory/.booth.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "booth" Changes: -------- --- /work/SRC/openSUSE:Factory/booth/booth.changes 2015-11-28 15:19:06.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.booth.new/booth.changes 2015-12-09 22:13:08.000000000 +0100 @@ -1,0 +2,23 @@ +Thu Dec 03 10:59:27 UTC 2015 - [email protected] + +- Update to version v0.2.0_130_g9c5c19f: + + test: use SSH_OPTS for rsync too + + test: fix external/booth ip use + +------------------------------------------------------------------- +Wed Dec 02 11:31:24 UTC 2015 - [email protected] + +- Update to version v0.2.0_128_g29be3ec: + + test: create and distribute authfile + + test: allow alternative ip addresses + + config: support for comments + +------------------------------------------------------------------- +Mon Nov 30 18:20:49 UTC 2015 - [email protected] + +- Update to version v0.2.0_126_g2154ade: + + main: add 'other' as possible site reference + + attr: GEO attributes OCF RA support (fate#318182) + + ocf: add geostore sample RA (fate#318182) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ booth.spec ++++++ --- /var/tmp/diff_new_pack.pnHeyN/_old 2015-12-09 22:13:09.000000000 +0100 +++ /var/tmp/diff_new_pack.pnHeyN/_new 2015-12-09 22:13:09.000000000 +0100 @@ -144,9 +144,14 @@ %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d %dir /usr/lib/ocf/resource.d/pacemaker +%dir /usr/lib/ocf/resource.d/booth +%dir /usr/lib/ocf/lib +%dir /usr/lib/ocf/lib/booth %dir %{_sysconfdir}/booth %{_sbindir}/rcbooth-arbitrator /usr/lib/ocf/resource.d/pacemaker/booth-site +/usr/lib/ocf/lib/booth/geo_attr.sh +/usr/lib/ocf/resource.d/booth/geostore %config %{_sysconfdir}/booth/booth.conf.example %if %{defined _unitdir} ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.pnHeyN/_old 2015-12-09 22:13:09.000000000 +0100 +++ /var/tmp/diff_new_pack.pnHeyN/_new 2015-12-09 22:13:09.000000000 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/ClusterLabs/booth.git</param> - <param name="changesrevision">88c3d6a865cea676778bdeb7858f715a6ece6b10</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">9c5c19f2c9217db9bf6265e8e753ac15ba631ae0</param></service></servicedata> \ No newline at end of file ++++++ booth.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/.git_info new/booth/.git_info --- old/booth/.git_info 2015-11-24 14:08:30.000000000 +0100 +++ new/booth/.git_info 2015-12-03 11:52:44.000000000 +0100 @@ -1 +1 @@ -v0.2.0-120-gf3d73a5 +v0.2.0-130-g9c5c19f diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/Makefile.am new/booth/Makefile.am --- old/booth/Makefile.am 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/Makefile.am 2015-12-03 11:52:35.000000000 +0100 @@ -55,7 +55,10 @@ boothsite_SCRIPTS = script/ocf/booth-site boothocfdir = /usr/lib/ocf/resource.d/booth -boothocf_SCRIPTS = script/ocf/sharedrsc +boothocf_SCRIPTS = script/ocf/sharedrsc script/ocf/geostore + +boothocflibdir = /usr/lib/ocf/lib/booth +boothocflib_DATA = script/ocf/geo_attr.sh bootharbitratordir = ${INITDDIR} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/booth.spec new/booth/booth.spec --- old/booth/booth.spec 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/booth.spec 2015-12-03 11:52:35.000000000 +0100 @@ -133,9 +133,14 @@ %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d %dir /usr/lib/ocf/resource.d/pacemaker +%dir /usr/lib/ocf/resource.d/booth +%dir /usr/lib/ocf/lib +%dir /usr/lib/ocf/lib/booth %dir %{_sysconfdir}/booth %{_sbindir}/rcbooth-arbitrator /usr/lib/ocf/resource.d/pacemaker/booth-site +/usr/lib/ocf/lib/booth/geo_attr.sh +/usr/lib/ocf/resource.d/booth/geostore %config %{_sysconfdir}/booth/booth.conf.example %if 0%{?suse_version} %config %{_fwdefdir}/booth diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/docs/boothd.8.txt new/booth/docs/boothd.8.txt --- old/booth/docs/boothd.8.txt 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/docs/boothd.8.txt 2015-12-03 11:52:35.000000000 +0100 @@ -65,6 +65,10 @@ *-s*:: Site address or name. ++ + The special value 'other' can be used to specify the other + site. Obviously, in that case, the booth configuration must + have exactly two sites defined. *-F*:: 'immediate grant': Don't wait for unreachable sites to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/docs/geostore.8.txt new/booth/docs/geostore.8.txt --- old/booth/docs/geostore.8.txt 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/docs/geostore.8.txt 2015-12-03 11:52:35.000000000 +0100 @@ -42,13 +42,13 @@ -------------- --------------------- -# geostore set -t ticket-A -s 44.0.0.61 bigdb-repl-status UPTODATE +# geostore set -t ticket-A -s other bigdb-repl-status UPTODATE -# geostore get -t ticket-A -s 44.0.0.61 bigdb-repl-status +# geostore get -t ticket-A -s other bigdb-repl-status # geostore delete -t ticket-A -s 44.0.0.61 bigdb-repl-status -# geostore list -t ticket-A -s 44.0.0.61 +# geostore list -t ticket-A -s other --------------------- @@ -62,6 +62,10 @@ *-s*:: Site address or name where the attribute is to be stored/retrieved. ++ + The special value 'other' can be used to specify the other + site. Obviously, in that case, the booth configuration must + have exactly two sites defined. *-c* 'configfile':: Configuration to use. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/script/ocf/geo_attr.sh new/booth/script/ocf/geo_attr.sh --- old/booth/script/ocf/geo_attr.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/booth/script/ocf/geo_attr.sh 2015-12-03 11:52:35.000000000 +0100 @@ -0,0 +1,203 @@ +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +# + +# This file is part of the booth project and contains /bin/sh +# code to support GEO attributes + +# USAGE +# +# To use this for updating GEO attributes just follow the +# instructions below. + +# Source this file in your OCF RA script: +# +## . ${OCF_ROOT}/lib/booth/geo_attr.sh + +# 1) meta-data +# +# geo_attr_meta_data prints descriptions of three parameters. +# Best to invoke it just before printing "</parameters>". For +# instance: +# +## cat <<EOF +## <?xml version="1.0"?> +## ... +## <parameters> +## ... +## `geo_attr_meta_data` +## </parameters> +## ... +## EOF + +# 2) validation (validate-all) +# +# Invoke geo_attr_validate_all to test the environment: +# +## if ! geo_attr_validate_all; then +## return $OCF_ERR_INSTALL +## fi + +# 3) Attribute updating +# +# Put something like the following code after the RA updated the +# remote site state (e.g. data replication): +# +## if [ -n "$OCF_RESKEY_booth_ticket" ]; then +## if geo_attr_geo_attr $outcome; then +## # success! +## else +## # failed to set the attribute +## # appropriate error was already logged +## # normally, more cannot be done at this point +## # because updating GEO attributes is +## # essentially a best effort operation +## fi +## fi +# +# The outcome variable is a boolean. +# It should reflect the outcome of the operation to update +# data at the site (set to "0" for failure, anything else for +# success). + +# 4) Site name (optional) +# +# We use the special value 'other' to specify the site where the +# attribute is to be updated. That should cover the majority of +# GEO clusters. In case your setup has more than two sites, then +# provide a function named get_site_name which should print the +# appropriate site name (as specified in booth.conf too) to +# stdout. +# + +DEFAULT_BOOTH_CONF="/etc/booth/booth.conf" +: ${OCF_RESKEY_booth_config:=$DEFAULT_BOOTH_CONF} + +geo_attr_meta_data() { + cat <<END + +<parameter name="booth_ticket"> +<longdesc lang="en"> +Booth ticket. Need to define this to activate GEO attribute +updating. See also the booth_config and geo_attribute parameters. +</longdesc> +<shortdesc lang="en">Booth ticket</shortdesc> +<content type="string" default="" /> +</parameter> + +<parameter name="booth_config"> +<longdesc lang="en"> +Booth configuration name (or configuration filename) to use. +</longdesc> +<shortdesc lang="en">BOOTH configuration file</shortdesc> +<content type="string" default="$DEFAULT_BOOTH_CONF" /> +</parameter> + +<parameter name="geo_attribute"> +<longdesc lang="en"> +Attribute name. If not specified, we'll get the name from the +first "attr-prereq" definition for the given ticket. This +normally needs to be used only in case there are multiple +"attr-prereq" directives for the ticket. +</longdesc> +<shortdesc lang="en">GEO attribute</shortdesc> +<content type="string" default="" /> +</parameter> + +END +} + +geo_attr_get_attr() { + local tkt cnf attr + tkt=$OCF_RESKEY_booth_ticket + cnf=$OCF_RESKEY_booth_config + attr=$OCF_RESKEY_geo_attribute + + awk -v attr="$attr" ' +n && /^[[:space:]]*attr-prereq = auto .* eq / { + if (attr == "" || attr == $4) { + print $4,$6; exit + } +} +n && (/^$/ || /^ticket.*/) {exit} +/^ticket.*'$tkt'/ {n=1} +' $cnf +} + +# arguments: +# $1: 0 reset the attribute +# != 0 set the attribute +# +geo_attr_geo_attr() { + local val site + + val=$1 + set -- `geo_attr_get_attr` + if test z"`command -v get_site_name`" = z"get_site_name"; then + site=`get_site_name` + else + site="other" + fi + + if [ "$val" = "0" ]; then + geostore delete -s $site $1 >/dev/null 2>&1 + else + geostore set -s $site $1 $2 + fi +} + +geo_attr_read_attr() { + local site + + set -- `geo_attr_get_attr` + if test z"`command -v get_site_name`" = z"get_site_name"; then + site=`get_site_name` + else + site="other" + fi + + geostore get -s $site $1 +} + +# test the environment for geo_attr +# +geo_attr_validate_all() { + if [ -z "$OCF_RESKEY_booth_ticket" ]; then + return 0 + fi + + if ! test -f "$OCF_RESKEY_booth_config"; then + ocf_log err "booth configuration $OCF_RESKEY_booth_config doesn't exist" + return 1 + fi + + if ! grep -qs "^ticket[[:space:]]*=[[:space:]]*\"$OCF_RESKEY_booth_ticket\"" $OCF_RESKEY_booth_config; then + ocf_log err "ticket $OCF_RESKEY_booth_ticket not found in $OCF_RESKEY_booth_config" + return 1 + fi + + set -- `geo_attr_get_attr` + if [ $# -eq 0 ]; then + ocf_log err "no attr-prereq defined in $OCF_RESKEY_booth_ticket" + return 1 + fi + + return 0 +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/script/ocf/geostore new/booth/script/ocf/geostore --- old/booth/script/ocf/geostore 1970-01-01 01:00:00.000000000 +0100 +++ new/booth/script/ocf/geostore 2015-12-03 11:52:35.000000000 +0100 @@ -0,0 +1,112 @@ +#!/bin/sh +# +# +# geostore OCF RA. Just an example on how to use +# geo-attr.sh +# +# Copyright (c) 2015 Dejan Muhamedagic <[email protected]> +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +# + +####################################################################### +# Initialization: + +: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} +. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs +. ${OCF_ROOT}/lib/booth/geo_attr.sh + +####################################################################### + +geostore_meta_data() { + cat <<END +<?xml version="1.0"?> +<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> +<resource-agent name="$NAME" version="0.9"> +<version>1.0</version> + +<longdesc lang="en"> +This is the geostore Resource Agent. It's a sample for how to use +geo_attr.sh. +</longdesc> +<shortdesc lang="en">Sample GEO attribute RA</shortdesc> + +<parameters> +`geo_attr_meta_data` +</parameters> + +<actions> +<action name="start" timeout="20" /> +<action name="stop" timeout="20" /> +<action name="monitor" timeout="20" interval="10" depth="0" /> +<action name="reload" timeout="20" /> +<action name="migrate_to" timeout="20" /> +<action name="migrate_from" timeout="20" /> +<action name="meta-data" timeout="5" /> +<action name="validate-all" timeout="20" /> +</actions> +</resource-agent> +END +} + +####################################################################### + +geostore_usage() { + cat <<END +usage: $0 {start|stop|monitor|migrate_to|migrate_from|validate-all|meta-data} + +Expects to have a fully populated OCF RA-compliant environment set. +END +} + +geostore_start() { + if [ -n "$OCF_RESKEY_booth_ticket" ]; then + geo_attr_geo_attr 1 + ocf_log info "set GEO attribute to `geo_attr_read_attr`" + fi + ha_pseudo_resource geostore_${OCF_RESOURCE_INSTANCE} start +} + +geostore_stop() { + if [ -n "$OCF_RESKEY_booth_ticket" ]; then + geo_attr_geo_attr 0 + ocf_log info "removed GEO attribute" + fi + ha_pseudo_resource geostore_${OCF_RESOURCE_INSTANCE} stop +} + +geostore_monitor() { + if ha_pseudo_resource geostore_${OCF_RESOURCE_INSTANCE} monitor + then + return $OCF_SUCCESS + else + return $OCF_NOT_RUNNING + fi +} + +geostore_validate_all() { + if ! geo_attr_validate_all; then + return $OCF_ERR_INSTALL + fi + return $OCF_SUCCESS +} + +ocf_rarun $* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/config.c new/booth/src/config.c --- old/booth/src/config.c 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/src/config.c 2015-12-03 11:52:35.000000000 +0100 @@ -532,7 +532,7 @@ lineno++; s = skip_while(line, isspace); - if (is_end_of_line(s)) + if (is_end_of_line(s) || *s == '#') continue; key = s; @@ -580,7 +580,7 @@ /* Remove and skip quote */ *s = 0; s++; - if (* skip_while(s, isspace)) { + if (*(s = skip_while(s, isspace)) && *s != '#') { error = "Surplus data after value"; goto err; } @@ -892,6 +892,30 @@ } +static int get_other_site(struct booth_site **node) +{ + struct booth_site *n; + int i; + + *node = NULL; + if (!booth_conf) + return 0; + + for (i = 0; i < booth_conf->site_count; i++) { + n = booth_conf->site + i; + if (n != local && n->type == SITE) { + if (!*node) { + *node = n; + } else { + return 0; + } + } + } + + return !*node ? 0 : 1; +} + + int find_site_by_name(unsigned char *site, struct booth_site **node, int any_type) { struct booth_site *n; @@ -900,6 +924,9 @@ if (!booth_conf) return 0; + if (!strcmp(site, OTHER_SITE)) + return get_other_site(node); + for (i = 0; i < booth_conf->site_count; i++) { n = booth_conf->site + i; if ((n->type == SITE || any_type) && @@ -937,7 +964,6 @@ } - const char *type_to_string(int type) { switch (type) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/config.h new/booth/src/config.h --- old/booth/src/config.h 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/src/config.h 2015-12-03 11:52:35.000000000 +0100 @@ -35,6 +35,7 @@ #define MAX_ARGS 16 #define TICKET_ALLOC 16 +#define OTHER_SITE "other" typedef enum { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/main.c new/booth/src/main.c --- old/booth/src/main.c 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/src/main.c 2015-12-03 11:52:35.000000000 +0100 @@ -1130,8 +1130,8 @@ * on one machine. */ if (cl.type == CLIENT || cl.type == GEOSTORE || (cl.type == DAEMON && debug_level)) { - int re = host_convert(optarg, site_arg, INET_ADDRSTRLEN); - if (re == 0) { + if (strcmp(optarg, OTHER_SITE) && + host_convert(optarg, site_arg, INET_ADDRSTRLEN) == 0) { safe_copy(cl.site, site_arg, sizeof(cl.site), "site name"); } else { safe_copy(cl.site, optarg, sizeof(cl.site), "site name"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/test/live_test.sh new/booth/test/live_test.sh --- old/booth/test/live_test.sh 2015-11-23 19:13:11.000000000 +0100 +++ new/booth/test/live_test.sh 2015-12-03 11:52:35.000000000 +0100 @@ -41,6 +41,7 @@ [ $# -eq 0 ] && usage 0 cnf=$1 +BOOTH_DIR="/etc/booth" run_cnf="/etc/booth/booth.conf" shift 1 @@ -54,6 +55,10 @@ local n=$1 echo $sites | awk '{print $'$n'}' } +get_internal_site() { + local n=$1 + echo $internal_sites | awk '{print $'$n'}' +} logmsg() { if [ "$WE_SERVER" -o "$_JUST_NETEM" ]; then @@ -274,15 +279,23 @@ is_pacemaker_running() { local h for h in $sites; do - crmadmin -D >/dev/null || return 1 + runcmd $h crmadmin -D >/dev/null || return 1 done return 0 } sync_conf() { local h rc=0 + local tmpf for h in $sites $arbitrators; do - rsync -q $cnf root@$h:$run_cnf + rsync -q -e "ssh $SSH_OPTS" $cnf root@$h:$run_cnf rc=$((rc|$?)) + if [ -n "$authfile" ]; then + tmpf=`mktemp` + scp -q $(get_site 1):$authfile $tmpf && + rsync -q -e "ssh $SSH_OPTS" $tmpf root@$h:$authfile + rc=$((rc|$?)) + rm -f $tmpf + fi done return $rc } @@ -355,13 +368,21 @@ runcmd $h crm_node -l | awk '{print $2}' done } -get_port() { - grep "^port" | - sed -n 's/.*="//;s/"//p' -} -get_servers() { - grep "^$1" | - sed -n 's/.*="//;s/"//p' +extract_value() { + sed 's/ *#.*//;s/.*=//;s/"//g;s/^ *//;s/ *$//' +} +get_extern_ip() { + grep "^$1" | + awk ' + { if(/# *external[_-]ip=/) print $NF; else print; } + ' | extract_value +} +get_value() { + grep "^$1" | extract_value +} +# get internal IP for the external address +internal_ip() { + fgrep "$1" $cnf | extract_value } get_rsc() { awk ' @@ -380,15 +401,15 @@ set_site_attr() { local site - site=`get_site $1` + site=$1 set -- `get_attr` - geostore set -s $site $1 $2 + run_site $site geostore set $1 $2 } del_site_attr() { local site - site=`get_site $1` + site=$1 set -- `get_attr` - geostore delete -s $site $1 + run_site $site geostore delete $1 } break_external_prog() { run_site $1 crm configure "location $PREFNAME `get_rsc` rule -inf: defined \#uname" @@ -474,7 +495,7 @@ for h in $sites; do if is_cib_granted $h; then [ -n "$gh" ] && rc=1 # granted twice - gh="$gh $h" + gh="$gh `internal_ip $h`" fi done [ -z "$gh" ] && gh="none" @@ -489,8 +510,9 @@ return $rc } check_cib() { - local exp_grantee=$1 cib_grantee booth_grantee + local exp_grantee cib_grantee booth_grantee local rc=0 pending + exp_grantee=$1 booth_grantee=`booth_where_granted` pending=$? cib_grantee=`check_cib_consistency` @@ -703,6 +725,7 @@ echo "unexpected: dependent resource failure" run_report $start_ts $end_ts $TEST reboot_test + master_rc=1 fi revoke_ticket } @@ -726,7 +749,7 @@ grant_ticket 1 } check_grant() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: longgrant ## @@ -741,7 +764,7 @@ wait_exp } check_longgrant() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: longgrant2 ## @@ -757,7 +780,7 @@ done } check_longgrant2() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: grant_noarb ## @@ -774,7 +797,7 @@ grant_ticket 1 } check_grant_noarb() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } recover_grant_noarb() { local h @@ -803,10 +826,10 @@ # just a grant to another site test_grant_elsewhere() { - run_site 1 booth grant -w -s `get_site 2` $tkt >/dev/null + run_site 1 booth grant -w -s `get_internal_site 2` $tkt >/dev/null } check_grant_elsewhere() { - check_consistency `get_site 2` + check_consistency `get_internal_site 2` } ## TEST: grant_site_lost ## @@ -822,7 +845,7 @@ wait_exp } check_grant_site_lost() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } recover_grant_site_lost() { start_site `get_site 2` @@ -839,14 +862,14 @@ } test_grant_site_reappear() { grant_ticket 1 || return $ERR_SETUP_FAILED - check_cib `get_site 1` || return $ERR_SETUP_FAILED + check_cib `get_internal_site 1` || return $ERR_SETUP_FAILED wait_timeout start_site `get_site 2` || return $ERR_SETUP_FAILED wait_timeout wait_timeout } check_grant_site_reappear() { - check_consistency `get_site 1` && + check_consistency `get_internal_site 1` && is_cib_granted `get_site 1` } recover_grant_site_reappear() { @@ -875,7 +898,7 @@ wait_timeout } check_simultaneous_start_even() { - check_consistency `get_site 2` + check_consistency `get_internal_site 2` } ## TEST: slow_start_granted ## @@ -897,7 +920,7 @@ done } check_slow_start_granted() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: restart_granted ## @@ -911,7 +934,7 @@ wait_timeout } check_restart_granted() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: reload_granted ## @@ -925,7 +948,7 @@ wait_timeout } check_reload_granted() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: restart_granted_nocib ## @@ -943,7 +966,7 @@ wait_timeout } check_restart_granted_nocib() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: restart_notgranted ## @@ -959,7 +982,7 @@ wait_timeout } check_restart_notgranted() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: failover ## @@ -1027,7 +1050,7 @@ wait_timeout } check_split_follower() { - check_consistency `get_site 1` + check_consistency `get_internal_site 1` } ## TEST: split_edge ## @@ -1062,7 +1085,7 @@ } check_external_prog_failed() { check_consistency any && - [ `booth_where_granted` != `get_site 1` ] + [ `booth_where_granted` != `get_internal_site 1` ] } recover_external_prog_failed() { repair_external_prog 1 @@ -1086,7 +1109,7 @@ wait_timeout } check_attr_prereq_ok() { - check_consistency `get_site 2` + check_consistency `get_internal_site 2` } recover_attr_prereq_ok() { start_site `get_site 1` @@ -1169,15 +1192,18 @@ exit 1 } -sites=`get_servers site < $cnf` -arbitrators=`get_servers arbitrator < $cnf` +sites=`get_extern_ip site < $cnf` +arbitrators=`get_extern_ip arbitrator < $cnf` +internal_sites=`get_value site < $cnf` +internal_arbitrators=`get_value arbitrator < $cnf` all_nodes=`get_all_nodes` -port=`get_port < $cnf` +port=`get_value port < $cnf` : ${port:=9929} -site_cnt=`echo $sites | wc -w` -arbitrator_cnt=`echo $arbitrators | wc -w` +site_cnt=`echo $internal_sites | wc -w` +arbitrator_cnt=`echo $internal_arbitrators | wc -w` tkt=`get_tkt < $cnf` eval `get_tkt_settings` + MIN_TIMEOUT=`awk -v tm=$T_timeout 'BEGIN{ if (tm >= 2) print tm; else print 2*tm; @@ -1190,7 +1216,7 @@ exit fi -[ -z "$sites" ] && { +[ -z "$internal_sites" ] && { echo no sites in $cnf usage 1 } @@ -1214,6 +1240,9 @@ PREFNAME=__pref_booth_live_test +authfile=`get_value authfile < $cnf` +run_site 1 'test -f '"$authfile"' || booth-keygen '"$authfile" + sync_conf || exit reboot_test all_booth_status || { @@ -1238,6 +1267,9 @@ failover split_leader split_follower split_edge external_prog_failed attr_prereq_ok attr_prereq_fail"} +master_rc=0 # updated in runtest for t in $TESTS; do runtest $t done + +exit $master_rc
