Show
Ignore:
Timestamp:
11/05/09 21:16:03 (4 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1257455763 +0000
git-parent:

[c819664d8b0fac9982fc9b66745eeb3956bf0795]

git-author:
Mark Harrison <mark@omniti.com> 1257455763 +0000
Message:

Merge the test suite changes into the classes branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • test/test.sh

    r816d936 r65023b9  
    11#!/bin/bash 
    2 SRCPOOL=zbsrctest 
    3 DSTPOOL=zbdsttest 
    4 POOLSIZE=100M 
    5  
    6 LOGFILE=zbtest.log 
    7  
    8 # Commands 
    9 ZPOOL=/usr/sbin/zpool 
    10 ZFS=/usr/sbin/zfs 
    11 DATE=/bin/date 
    12 ZETABACK=$PWD/../zetaback 
    13  
    14 # Utility functions 
    15 log() { 
    16     echo "`$DATE '+%Y-%m-%d %H:%M:%S'` : $@" 
    17     echo "`$DATE '+%Y-%m-%d %H:%M:%S'` : $@" >> $LOGFILE 
    18 
    19  
    20 yesno() { 
    21     local REPLY 
    22     echo -n "$@ (y/n) " 
    23     read 
    24     while [[ "$REPLY" != "n" && $REPLY != "y" ]]; do 
    25         echo -n "Valid answers are y, n" 
    26         read 
    27     done 
    28     # log the question and answer 
    29     log "$@ (y/n) $REPLY" 
    30     # Return true if we answered yes 
    31     [[ $REPLY == 'y' ]] 
    32 
    33  
    34 require_root() { 
    35     if [[ $UID != 0 ]]; then 
    36         echo This script must be run as root 
    37         exit 1 
    38     fi 
    39 
     2. lib/config.sh 
     3. lib/functions.sh 
    404 
    415# Test script specific functions 
     
    7236    create_zfs $SRCPOOL/test/foo/bar 
    7337    create_zfs $SRCPOOL/test/baz 
     38    zetaback_setclass $SRCPOOL/test/baz testclass 
    7439} 
    7540 
     
    7843    cat > zetaback_test.conf <<EOF 
    7944default { 
    80     store = /$DSTPOOL 
     45    store = /$DSTPOOL/%h 
    8146    archive = /$DSTPOOL/archives 
    8247    agent = "$PWD/../zetaback_agent -c $PWD/zetaback_agent_test.conf" 
    8348    backup_interval = 10 
    8449    full_interval = 604800 
     50} 
     51 
     52testclass { 
     53    type = class 
     54    store = /$DSTPOOL/classy/%h 
    8555} 
    8656 
     
    10777} 
    10878 
     79zetaback_setclass() { 
     80    log "Setting zetaback class property on $1 to $2" 
     81    `zfs set com.omniti.labs.zetaback:class=$2 $1` 
     82} 
     83 
    10984### Main program thread 
    11085require_root