[PATCH] New tests for yesterday's fixes

Jim Meyering jim at meyering.net
Thu Oct 21 19:52:23 UTC 2010


Jeff Darcy wrote:
> [PATCH 1/3] Fixed X-redhat-role check.
> rest.c: validate_put fails if hdr present on master
> t/basic: new test for PUT rejected due to role
> t/replication: added missing -m to downstream iwhd
>
> [PATCH 2/3] Add test for re-replication when an attribute changes.
>
> [PATCH 3/3] Add test for truncation when overwriting an object.
> Also added test-file-usage info in t/basic and t/replication.
...
> Subject: [PATCH 3/3] Add test for truncation when overwriting an object.
>
> Also added test-file-usage info in t/basic and t/replication.
> ---
>  t/basic       |   16 +++++++++++++++-
>  t/replication |    7 +++++++
>  2 files changed, 22 insertions(+), 1 deletions(-)
>
> diff --git a/t/basic b/t/basic
> index b62b7cc..0d15629 100644
> --- a/t/basic
> +++ b/t/basic
> @@ -1,6 +1,15 @@
>  #!/bin/sh
>  # Test basic functionality.
>
> +# TEST-FILE USAGE
> +#	f1	object put/get/delete
> +#	f2	bucket listing
> +#	f3	attribute PUT, headless operation
> +#	f4	attribute POST
> +#	f5	reserved attr
> +#	f6	X-redhat-role
> +#	f7	truncation
> +
>  . "${srcdir=.}/init.sh"; path_prepend_ ..
>
>  mkdir FS mongod iwhd || framework_failure_ mkdir failed
> @@ -180,7 +189,6 @@ grep ' 404$' del_nosuch.err || fail=1
>  echo hello | curl -f -T - -H "X-redhat-role: master" $bucket/f6 2> role.err
>  grep ' 403$' role.err || fail=1
>
> -
>  # ################## Providers
>
>  p_name=primary
> @@ -269,6 +277,12 @@ for attr in bucket key date etag loc; do
>    grep ' 400$' bad_attr.err || fail=1
>  done
>
> +# Make sure PUTting a file truncates.
> +echo hello | curl -f -T - $bucket/f7 || fail=1
> +echo bye | curl -f -T - $bucket/f7 || fail=1
> +cat FS/b1/f7
> +test "$(cat FS/b1/f7)" = bye || fail=1

ACK to all three.
The lone "cat FS/b1/f7" above must be for debugging,
but if it served you once, it's fine to leave it.


More information about the iwhd-devel mailing list