aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-02-20 20:47:58 -0800
committerRuss Allbery <rra@stanford.edu>2010-02-20 20:47:58 -0800
commitda4a4051085c857c1ee50080309190ea1113b18e (patch)
tree1ee89581f7e0f4441166e8e4938e5eb537e0c661 /tests
parent4f863ccc9531130be3f4aecea341a0e8a66c6f8c (diff)
Add a check to the full client test suite for storing a nul
Diffstat (limited to 'tests')
-rw-r--r--tests/client/full-t.in18
-rw-r--r--tests/data/full.conf1
2 files changed, 18 insertions, 1 deletions
diff --git a/tests/client/full-t.in b/tests/client/full-t.in
index 8acc360..ce2789d 100644
--- a/tests/client/full-t.in
+++ b/tests/client/full-t.in
@@ -11,7 +11,7 @@
# is loaded, and it's pulled in as a prerequisite for Wallet::Admin.
BEGIN { $ENV{WALLET_CONFIG} = "$ENV{SOURCE}/data/wallet.conf" }
-BEGIN { our $total = 53 }
+BEGIN { our $total = 59 }
use Test::More tests => $total;
use lib "$ENV{SOURCE}/../perl";
@@ -168,6 +168,22 @@ SKIP: {
is ($out, '-q', ' with the right output');
is ($err, '', ' and no error');
+ # Store data containing nul characters.
+ my $data = "Some data\000with a nul";
+ open (IN, '>', 'tmp-file') or BAIL_OUT ("cannot create tmp-file: $!");
+ print IN $data;
+ close IN;
+ ($out, $err, $status) = wallet ($principal, '-f', 'tmp-file', 'store',
+ 'file', 'auto');
+ unlink ('tmp-file');
+ is ($status, 0, 'Storing data with a nul succeeds');
+ is ($out, '', ' with no output');
+ is ($err, '', ' and no error');
+ ($out, $err, $status) = wallet ($principal, 'get', 'file', 'auto');
+ is ($status, 0, 'Object get succeeds');
+ is ($out, $data, ' with the right output');
+ is ($err, '', ' and no error');
+
# All done.
remctld_stop;
$admin->destroy;
diff --git a/tests/data/full.conf b/tests/data/full.conf
index 4c0f435..941a9ac 100644
--- a/tests/data/full.conf
+++ b/tests/data/full.conf
@@ -1,3 +1,4 @@
# remctl configuration for full wallet client tests.
+wallet store data/cmd-wrapper stdin=4 ANYUSER
wallet ALL data/cmd-wrapper ANYUSER