tomb

the crypto undertaker
git clone git://parazyd.org/tomb.git
Log | Files | Refs | README | LICENSE

40_regression.sh (1228B)


      1 #!/usr/bin/env zsh
      2 
      3 export test_description="Tomb regression tests"
      4 
      5 source ./setup
      6 
      7 TOMB_VERSION=("2.3" "2.2" "2.0.1" "2.1")
      8 zshversion=$(zsh --version | awk 'NR==1 {print $2}')
      9 [[ $zshversion =~ "5.3" ]] && TOMB_VERSION=("2.3")
     10 
     11 for version in "${TOMB_VERSION[@]}"; do
     12     URL="https://files.dyne.org/tomb/old-releases/Tomb-$version.tar.gz"
     13 
     14     curl "$URL" > "$TMP/tomb-regression.tar.gz"
     15     mkdir -p "$TMP/tomb-regression"
     16     tar xfz "$TMP/tomb-regression.tar.gz" \
     17         --strip-components 1 -C "$TMP/tomb-regression"
     18     T="$TMP/tomb-regression/tomb"
     19     [[ "$version" == "$(${T} -v |& awk 'NR==1 {print $3}')" ]] || continue
     20 
     21     test_export "regression_$version"
     22     test_expect_success "Regression tests: opening old tomb ($version) with Tomb" "
     23         tt_dig -s 20 &&
     24         tt_forge --tomb-pwd $DUMMYPASS &&
     25         tt_lock --tomb-pwd $DUMMYPASS &&
     26         T='$TOMB_BIN' &&
     27         tt_open --tomb-pwd $DUMMYPASS &&
     28         tt_close
     29         "
     30 
     31     test_export "test" # Using already generated tomb
     32     test_expect_success "Regression tests: opening new tomb with Tomb $version" "
     33         export T='$TMP/tomb-regression/tomb' &&
     34         tt_open --tomb-pwd $DUMMYPASS &&
     35         tt_close
     36         "
     37 done
     38 
     39 test_done