summaryrefslogtreecommitdiff
path: root/test/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-02-07 20:03:44 +0000
committerChris Wilson <chris+github@qwirx.com>2014-02-07 20:03:44 +0000
commit8631c4fe809ab9b57212f345394e4532ad272983 (patch)
treeaf8519267a62a53e5d94f2a2e4c6037839283b67 /test/bbackupd
parentb2501248e2251d6601fbf2ad60ceb328d110593a (diff)
Fix bbackupquery accepting a command starting with options.
This should never have been a valid command, but was accepted before, and silently ignored because it was treated as an empty command. This obscured bad quoting of bbackupquery command-line arguments, allowing commands to appear to work, but not do what you expected.
Diffstat (limited to 'test/bbackupd')
-rw-r--r--test/bbackupd/testbbackupd.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 6cd8f27d..681b51cb 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -3953,6 +3953,14 @@ int test_bbackupd()
int test(int argc, const char *argv[])
{
{
+ // This is not a complete command, it should not parse!
+ BackupQueries::ParsedCommand cmd("-od", true);
+ TEST_THAT(cmd.mFailed);
+ TEST_EQUAL(NULL, cmd.pSpec);
+ TEST_EQUAL(0, cmd.mCompleteArgCount);
+ }
+
+ {
BackupDaemon daemon;
TEST_EQUAL(1234, daemon.ParseSyncAllowScriptOutput("test", "1234"));