[PATCH] Fix the smblcient utimes test in Europe

Alexander Bokovoy ab at samba.org
Tue Dec 5 09:31:04 UTC 2017


On ma, 04 joulu 2017, Jeremy Allison via samba-technical wrote:
> On Tue, Dec 05, 2017 at 02:12:38PM +1300, Andrew Bartlett wrote:
> > On Mon, 2017-12-04 at 17:02 -0800, Jeremy Allison wrote:
> > > On Tue, Dec 05, 2017 at 01:11:00PM +1300, Andrew Bartlett wrote:
> > > > On Thu, 2017-10-19 at 18:05 +0200, Andreas Schneider via samba-
> > > > technical wrote:
> > > > > Hi,
> > > > > 
> > > > > some of us life in a different timezone!
> > > > > 
> > > > > The attched patch fixes the test.
> > > > > 
> > > > > 
> > > > > Please review and push if OK.
> > > > 
> > > > G'Day Andreas and Jeremy,
> > > > 
> > > > Some of us live in New Zealand as well.  Could one of you please rework
> > > > to test to set a common timezone?
> > > 
> > > Can you try this to see if it fixes it ?
> > 
> > That works for me.
> > 
> > Thanks!
> 
> git-am fix for master. Push if happy !

> From 92622274c00cedce923c805b697ac9a75f375e24 Mon Sep 17 00:00:00 2001
> From: Jeremy Allison <jra at samba.org>
> Date: Mon, 4 Dec 2017 17:13:43 -0800
> Subject: [PATCH] s3: test_smbclient_s3: Correctly set and unset TZ variable
>  for test.
> 
> Signed-off-by: Jeremy Allison <jra at samba.org>
> ---
>  source3/script/tests/test_smbclient_s3.sh | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
> index d98da0dd260..84f6ef5892e 100755
> --- a/source3/script/tests/test_smbclient_s3.sh
> +++ b/source3/script/tests/test_smbclient_s3.sh
> @@ -1419,6 +1419,10 @@ test_utimes()
>  {
>      tmpfile=$PREFIX/smbclient_interactive_prompt_commands
>  
> +    saved_TZ="$TZ"
> +    TZ=UTC
> +    export TZ
> +
This has saved_TZ.

>      cat > $tmpfile <<EOF
>  del utimes_test
>  put ${SMBCLIENT} utimes_test
> @@ -1433,6 +1437,12 @@ EOF
>      out=`eval $cmd`
>      ret=$?
>  
> +    if [ -n "$SAVED_TZ" ] ; then
> +	export TZ="$SAVED_TZ"
> +    else
> +	unset TZ
> +    fi
> +
And here you deal with SAVED_TZ (notice all caps).

So TZ is not preserved.

>      if [ $ret != 0 ] ; then
>  	echo "$out"
>  	echo "failed utimes test with output $ret"
> -- 
> 2.15.0.531.g2ccb3012c9-goog
> 


-- 
/ Alexander Bokovoy



More information about the samba-technical mailing list