| 1 | #!/bin/bash
|
|---|
| 2 |
|
|---|
| 3 | RASQL="rasql --user rasadmin --passwd rasadmin --quiet"
|
|---|
| 4 | COLL=test_large
|
|---|
| 5 | TYPE=GreySet
|
|---|
| 6 |
|
|---|
| 7 | f=rasql_1.unknown
|
|---|
| 8 |
|
|---|
| 9 | function check()
|
|---|
| 10 | {
|
|---|
| 11 | if [ -f $f ]; then
|
|---|
| 12 | output=`file $f`
|
|---|
| 13 | if [ "$output" == "rasql_1.unknown: data" ]; then
|
|---|
| 14 | echo failed.
|
|---|
| 15 | else
|
|---|
| 16 | echo ok.
|
|---|
| 17 | fi
|
|---|
| 18 | else
|
|---|
| 19 | echo failed, file not found.
|
|---|
| 20 | fi
|
|---|
| 21 | rm -f $f
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | function test()
|
|---|
| 25 | {
|
|---|
| 26 | fn="$1"
|
|---|
| 27 | echo -n * function $fn...
|
|---|
| 28 | $RASQL -q "select $fn from $COLL as c" --out file > /dev/null
|
|---|
| 29 | check
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | # vary size in MB
|
|---|
| 33 | for sz in `seq 20`; do
|
|---|
| 34 | $RASQL -q "drop collection $COLL" > /dev/null
|
|---|
| 35 | $RASQL -q "create collection $COLL $TYPE" > /dev/null
|
|---|
| 36 |
|
|---|
| 37 | X=3
|
|---|
| 38 | Y=$(($sz * 262144))
|
|---|
| 39 |
|
|---|
| 40 | echo -------------------------------------------------------------------
|
|---|
| 41 | echo " Testing with $sz MB ($(($X*$Y)) B)"
|
|---|
| 42 | echo -------------------------------------------------------------------
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | # insert data
|
|---|
| 46 | $RASQL -q "insert into $COLL values marray i in [0:$X,0:$Y] values 2c" > /dev/null
|
|---|
| 47 |
|
|---|
| 48 | # test
|
|---|
| 49 | test "tiff(c)"
|
|---|
| 50 | test "png(c)"
|
|---|
| 51 | test "jpeg(c)"
|
|---|
| 52 | test 'encode(c, "GTiff")'
|
|---|
| 53 | test 'encode(c, "PNG")'
|
|---|
| 54 | done
|
|---|