From 70ac06033d28024fc8e3a64e4c678c07b7e76b98 Mon Sep 17 00:00:00 2001 From: lwang Date: Tue, 29 Mar 2005 02:59:37 +0000 Subject: [PATCH] lwizard supports multi-net --- lustre/tests/test-lwizard.sh | 44 ++++++++++++++++++ lustre/utils/lwizard | 107 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 130 insertions(+), 21 deletions(-) create mode 100755 lustre/tests/test-lwizard.sh diff --git a/lustre/tests/test-lwizard.sh b/lustre/tests/test-lwizard.sh new file mode 100755 index 0000000..5445b0a --- /dev/null +++ b/lustre/tests/test-lwizard.sh @@ -0,0 +1,44 @@ +#!/usr/bin/expect + +spawn lwizard $argv +set timeout 3 +expect { + "overwrite existing" { + interact + } +} +expect "HOSTNAME for mds" +send -- "localhost\n" +expect "network INTERFACE" +send -- "192.168.1.29/24 10.0.0.29/24\n" +expect "enter the device or loop file name for mds" +send -- "/tmp/mds\n" +expect "device SIZE" +send -- "10000\n" +expect "configure FAILOVER" +send -- "n\n" +expect "HOSTNAME for ost" +send -- "localhost\n" +expect "network INTERFACE" +send -- "192.168.1.29/24 10.0.0.29/24\n" +expect "device or loop file name for ost" +send -- "/tmp/ost\n" +expect "device SIZE" +send -- "10000\n" +expect "configure FAILOVER" +send -- "n\n" +expect "HOSTNAME for ost" +send -- "\n" +expect "clients' mountpoint" +send -- "\n" +expect "configure another client with multiple network interfaces" +send -- "y\n" +expect "HOSTNAME" +send -- "node\n" +expect "network interface address" +send -- "192.168.1.29/24 10.0.0.29/24\n" +expect "configure another client with multiple network interfaces" +send -- "n\n" +expect "Lustre configuration has been written" +send -- "\n" +close diff --git a/lustre/utils/lwizard b/lustre/utils/lwizard index c7f8ea9..649b285 100755 --- a/lustre/utils/lwizard +++ b/lustre/utils/lwizard @@ -117,9 +117,9 @@ in_list() for node in $2 ; do [ "$1" = "$node" ] && return 0 - done - return 1 - } + done + return 1 +} # read device size from user and check devive size and convert device # size to *K @@ -162,12 +162,14 @@ add_device() local hostnames local device local device_size + local hostname + local interfaces echo "Creating $1 \"$1$2\"..." if [ "$2" -gt "1" ]; then - echo -n "Please enter the hostname(s) for $1$2, or just hit enter to finish: " + echo -n "Please enter the HOSTNAME for $1$2, or just hit enter to finish: " else - echo -n "Please enter the hostname(s) for $1$2: " + echo -n "Please enter the HOSTNAME for $1$2: " fi read hostnames @@ -175,9 +177,23 @@ add_device() return 1 fi + # Why do we need multiple hosts for a device? If we just want to support + # failover, we already have. for hostname in $hostnames ; do - device= - while [ -z "$device" ] ; do + break + done + + # Multi-net + cat <