aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-02 14:47:46 -0400
committerFranklin Wei <me@fwei.tk>2018-07-02 14:47:46 -0400
commit0c51f1ee4f2fb9178cf3efc25f4b91c2e08b2c87 (patch)
tree7a44c3e9996dc76a95ad90758edf26efc495b37b
parent4d780768c7fd6378b30ef5a1fee348b2c925b20d (diff)
downloadcsaa-0c51f1ee4f2fb9178cf3efc25f4b91c2e08b2c87.zip
csaa-0c51f1ee4f2fb9178cf3efc25f4b91c2e08b2c87.tar.gz
csaa-0c51f1ee4f2fb9178cf3efc25f4b91c2e08b2c87.tar.bz2
csaa-0c51f1ee4f2fb9178cf3efc25f4b91c2e08b2c87.tar.xz
Fix test scripts
Fixes issue where dummy script wouldn't actually do anything.
-rw-r--r--client.c12
-rw-r--r--dummy_client.c5
-rwxr-xr-xtestcreate.sh4
-rwxr-xr-xtestdummy.sh4
-rwxr-xr-xtestmodify.sh4
-rwxr-xr-xtestmodifyenc.sh4
-rwxr-xr-xtestretrieve.sh4
7 files changed, 28 insertions, 9 deletions
diff --git a/client.c b/client.c
index 1837f17..d4cc140 100644
--- a/client.c
+++ b/client.c
@@ -743,10 +743,12 @@ int main(int argc, char *argv[]) {
signal(SIGPIPE, SIG_IGN);
- server_request(socket_path, userkey, user_id,
- cl_request, new_acl,
- buildcode_path, compose_path, image_path,
- file_key);
+ bool success = server_request(socket_path, userkey, user_id,
+ cl_request, new_acl,
+ buildcode_path, compose_path, image_path,
+ file_key);
+
+ return !success;
#if 0
fd = connect_to_service(socket_path);
@@ -772,6 +774,4 @@ int main(int argc, char *argv[]) {
NULL, NULL, NULL, NULL, NULL));
close(fd);
#endif
-
- return 0;
}
diff --git a/dummy_client.c b/dummy_client.c
index fe66b1b..1720cdc 100644
--- a/dummy_client.c
+++ b/dummy_client.c
@@ -148,8 +148,9 @@ bool parse_args(int argc, char *argv[])
}
else
{
- parse_args_fail = "Unknown parameter";
- return false;
+ /* ignore unknowns */
+ //parse_args_fail = "Unknown parameter";
+ //return false;
}
}
if(cl_request.type != USERREQ_NONE && user_id != 0)
diff --git a/testcreate.sh b/testcreate.sh
index 93fc617..dd4e875 100755
--- a/testcreate.sh
+++ b/testcreate.sh
@@ -3,4 +3,8 @@ echo "Create:"
for i in $(seq 1 100)
do
$1 -u 1 -k a create > /dev/null
+ if [[ $? -ne 0 ]]
+ then
+ echo "Request failed!"
+ fi
done
diff --git a/testdummy.sh b/testdummy.sh
index 547c510..1d3bf97 100755
--- a/testdummy.sh
+++ b/testdummy.sh
@@ -5,7 +5,9 @@ then
exit 1
fi
echo "Initializing..."
-./dummy_server 10 csaa.db --overwrite > /dev/null &
+rm csaa.db
+sqlite3 csaa.db < sqlinit.txt
+./dummy_server $1 csaa.db > /dev/null &
pid=$!
sleep 5
time ./testcreate.sh ./dummy_client
diff --git a/testmodify.sh b/testmodify.sh
index 98fbe2d..86a78d1 100755
--- a/testmodify.sh
+++ b/testmodify.sh
@@ -4,4 +4,8 @@ $1 -u 1 -k a create > /dev/null
for i in $(seq 1 100)
do
$1 -u 1 -k a modifyfile -f 1 -i container1/hello-world.tar > /dev/null
+ if [[ $? -ne 0 ]]
+ then
+ echo "Request failed!"
+ fi
done
diff --git a/testmodifyenc.sh b/testmodifyenc.sh
index d942ea1..96457ba 100755
--- a/testmodifyenc.sh
+++ b/testmodifyenc.sh
@@ -4,4 +4,8 @@ $1 -u 1 -k a create > /dev/null
for i in $(seq 1 100)
do
$1 -u 1 -k a modifyfile -e -f 1 -i container1/hello-world.tar > /dev/null
+ if [[ $? -ne 0 ]]
+ then
+ echo "Request failed!"
+ fi
done
diff --git a/testretrieve.sh b/testretrieve.sh
index dbc18dd..566c48b 100755
--- a/testretrieve.sh
+++ b/testretrieve.sh
@@ -3,4 +3,8 @@ echo "Retrieve:"
for i in $(seq 1 100)
do
$1 -u 1 -k a retrievefile -f 1 -o out > /dev/null
+ if [[ $? -ne 0 ]]
+ then
+ echo "Request failed!"
+ fi
done