s3: test_smbclient_s3: Correctly set and unset TZ variable for test.
authorJeremy Allison <jra@samba.org>
Tue, 5 Dec 2017 01:13:43 +0000 (17:13 -0800)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 5 Dec 2017 07:55:44 +0000 (08:55 +0100)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Dec  5 08:55:44 CET 2017 on sn-devel-144

source3/script/tests/test_smbclient_s3.sh

index d98da0dd2606e344e1b04b2a23de82ee6a0b85a2..84f6ef5892ee7d7ee7ed5696a79c922b3d98887c 100755 (executable)
@@ -1419,6 +1419,10 @@ test_utimes()
 {
     tmpfile=$PREFIX/smbclient_interactive_prompt_commands
 
+    saved_TZ="$TZ"
+    TZ=UTC
+    export 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
+
     if [ $ret != 0 ] ; then
        echo "$out"
        echo "failed utimes test with output $ret"