append2.sh (d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf) | append2.sh (96950419f15510287080c557174e0d8409f06956) |
---|---|
1#!/bin/sh 2 3# A basic regression test for gconcat append using "gconcat label", 4# i.e., automatic mode. 5 6gconcat_check_size() 7{ 8 local actual expected name --- 17 unchanged lines hidden (view full) --- 26 27f1=$(mktemp) || exit 1 28truncate -s $((1024 * 1024 + $ss)) $f1 29f2=$(mktemp) || exit 1 30truncate -s $((1024 * 1024 + $ss)) $f2 31f3=$(mktemp) || exit 1 32truncate -s $((1024 * 1024 + $ss)) $f3 33 | 1#!/bin/sh 2 3# A basic regression test for gconcat append using "gconcat label", 4# i.e., automatic mode. 5 6gconcat_check_size() 7{ 8 local actual expected name --- 17 unchanged lines hidden (view full) --- 26 27f1=$(mktemp) || exit 1 28truncate -s $((1024 * 1024 + $ss)) $f1 29f2=$(mktemp) || exit 1 30truncate -s $((1024 * 1024 + $ss)) $f2 31f3=$(mktemp) || exit 1 32truncate -s $((1024 * 1024 + $ss)) $f3 33 |
34us0=$(attach_md -f $f1 -S $ss) || exit 1 35us1=$(attach_md -f $f2 -S $ss) || exit 1 36us2=$(attach_md -f $f3 -S $ss) || exit 1 | 34attach_md us0 -f $f1 -S $ss || exit 1 35attach_md us1 -f $f2 -S $ss || exit 1 36attach_md us2 -f $f3 -S $ss || exit 1 |
37 38gconcat label $name /dev/$us0 /dev/$us1 || exit 1 39devwait 40 41# We should have a 2MB device. Add another disk and verify that the 42# reported size of the concat device grows accordingly. A sector from 43# each disk is reserved for the metadata sector. 44gconcat_check_size "${name}" $((2 * 1024 * 1024)) --- 7 unchanged lines hidden (view full) --- 52# Stop the concat device and destroy the backing providers. 53gconcat stop ${name} || exit 1 54detach_md $us0 55detach_md $us1 56detach_md $us2 57 58# Re-create the providers and verify that the concat device comes 59# back and that the data is still there. | 37 38gconcat label $name /dev/$us0 /dev/$us1 || exit 1 39devwait 40 41# We should have a 2MB device. Add another disk and verify that the 42# reported size of the concat device grows accordingly. A sector from 43# each disk is reserved for the metadata sector. 44gconcat_check_size "${name}" $((2 * 1024 * 1024)) --- 7 unchanged lines hidden (view full) --- 52# Stop the concat device and destroy the backing providers. 53gconcat stop ${name} || exit 1 54detach_md $us0 55detach_md $us1 56detach_md $us2 57 58# Re-create the providers and verify that the concat device comes 59# back and that the data is still there. |
60us0=$(attach_md -f $f1 -S $ss) || exit 1 61us1=$(attach_md -f $f2 -S $ss) || exit 1 62us2=$(attach_md -f $f3 -S $ss) || exit 1 | 60attach_md us0 -f $f1 -S $ss || exit 1 61attach_md us1 -f $f2 -S $ss || exit 1 62attach_md us2 -f $f3 -S $ss || exit 1 |
63 64devwait 65 66# Make sure that the 67if [ -c /dev/concat/${name} ]; then 68 echo "ok - concat device was instantiated" 69else 70 echo "not ok - concat device was instantiated" 71fi 72 73if cmp -s $copy /dev/concat/${name}; then 74 echo "ok - Data was persisted across gconcat stop" 75else 76 echo "not ok - Data was persisted across gconcat stop" 77fi | 63 64devwait 65 66# Make sure that the 67if [ -c /dev/concat/${name} ]; then 68 echo "ok - concat device was instantiated" 69else 70 echo "not ok - concat device was instantiated" 71fi 72 73if cmp -s $copy /dev/concat/${name}; then 74 echo "ok - Data was persisted across gconcat stop" 75else 76 echo "not ok - Data was persisted across gconcat stop" 77fi |