]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2038] mysql lease-dump tests don't change time zone
authorAndrei Pavel <andrei@isc.org>
Thu, 13 Jan 2022 10:34:35 +0000 (12:34 +0200)
committerAndrei Pavel <andrei@isc.org>
Thu, 13 Jan 2022 12:54:02 +0000 (14:54 +0200)
src/bin/admin/tests/memfile_tests.sh.in
src/bin/admin/tests/mysql_tests.sh.in

index e6904368a8536efc87406e7402cd7161258b7916..b8e827f0025de9d5baa837bff49b6ff2e7be1970 100644 (file)
@@ -68,10 +68,10 @@ memfile_header_v6() {
 # Print data copied from mysql_upgrade_12_to_13_test and pgsql_upgrade_7_0_to_8_0.
 # @{
 memfile_data_v4() {
-    printf '0.0.0.10,32:30,33:30,40,1643757330,50,1,1,one&#x2cexample&#x2ccom,0,{ "a": 1&#x2c "b": 2 }'
+    printf '0.0.0.10,32:30,33:30,40,1678900000,50,1,1,one&#x2cexample&#x2ccom,0,{ "a": 1&#x2c "b": 2 }'
 }
 memfile_data_v6() {
-    printf '::10,32:30,30,1643757330,40,50,1,60,70,1,1,one&#x2cexample&#x2ccom,38:30,0,{ "a": 1&#x2c "b": 2 },90,16'
+    printf '::10,32:30,30,1678900000,40,50,1,60,70,1,1,one&#x2cexample&#x2ccom,38:30,0,{ "a": 1&#x2c "b": 2 },90,16'
 }
 # @}
 
index b75641bac3fcbf159f5974be64f9cb7fe43d2f91..8a5dd45054e76766aeeedf11a68e6b1f4956cf6f 100644 (file)
@@ -284,10 +284,7 @@ mysql_upgrade_12_to_13_test() {
 
     # Check lease4Dump*().
     run_command \
-        mysql_execute "
-            SET @@session.time_zone = '+00:00';
-            INSERT INTO lease4 VALUES(10,20,30,40,'2022-02-02 01:15:30',50,1,1,'one,example,com',0,'{ \"a\": 1, \"b\": 2 }');
-        "
+        mysql_execute "INSERT INTO lease4 VALUES(10,20,30,40,(SELECT FROM_UNIXTIME(1678900000)),50,1,1,'one,example,com',0,'{ \"a\": 1, \"b\": 2 }');"
     assert_eq 0 "${EXIT_CODE}" 'INSERT INTO lease4 failed, expected exit code %d, actual %d'
     assert_str_eq '' "${OUTPUT}"
 
@@ -297,20 +294,14 @@ mysql_upgrade_12_to_13_test() {
     assert_str_eq 'address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context' "${OUTPUT}"
 
     run_command \
-        mysql_execute "
-            SET @@session.time_zone = '+00:00';
-            CALL lease4DumpData();
-        "
+        mysql_execute "CALL lease4DumpData();"
     assert_eq 0 "${EXIT_CODE}" 'lease4DumpData() failed, expected exit code %d, actual %d'
     output=$(printf '%s' "${OUTPUT}" | sed 's/\t/,/g')  # turn tabs into commas
-    assert_str_eq '0.0.0.10,32:30,33:30,40,1643764530,50,1,1,one&#x2cexample&#x2ccom,0,{ "a": 1&#x2c "b": 2 }' "${output}"
+    assert_str_eq '0.0.0.10,32:30,33:30,40,1678900000,50,1,1,one&#x2cexample&#x2ccom,0,{ "a": 1&#x2c "b": 2 }' "${output}"
 
     # Check lease6Dump*().
     run_command \
-        mysql_execute "
-            SET @@session.time_zone = '+00:00';
-            INSERT INTO lease6 VALUES('::10',20,30,'2022-02-02 01:15:30',40,50,1,60,70,1,1,'one,example,com',80,90,16,0,'{ \"a\": 1, \"b\": 2 }');
-        "
+        mysql_execute "INSERT INTO lease6 VALUES('::10',20,30,(SELECT FROM_UNIXTIME(1678900000)),40,50,1,60,70,1,1,'one,example,com',80,90,16,0,'{ \"a\": 1, \"b\": 2 }');"
     assert_eq 0 "${EXIT_CODE}" 'INSERT INTO lease6 failed, expected exit code %d, actual %d'
     assert_str_eq '' "${OUTPUT}"
 
@@ -320,13 +311,10 @@ mysql_upgrade_12_to_13_test() {
     assert_str_eq 'address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,state,user_context,hwtype,hwaddr_source' "${OUTPUT}"
 
     run_command \
-        mysql_execute "
-            SET @@session.time_zone = '+00:00';
-            CALL lease6DumpData();
-        "
+        mysql_execute "CALL lease6DumpData();"
     assert_eq 0 "${EXIT_CODE}" 'lease6DumpData() failed, expected exit code %d, actual %d'
     output=$(printf '%s' "${OUTPUT}" | sed 's/\t/,/g')  # turn tabs into commas
-    assert_str_eq '::10,32:30,30,1643764530,40,50,1,60,70,1,1,one&#x2cexample&#x2ccom,38:30,0,{ "a": 1&#x2c "b": 2 },90,16' "${output}"
+    assert_str_eq '::10,32:30,30,1678900000,40,50,1,60,70,1,1,one&#x2cexample&#x2ccom,38:30,0,{ "a": 1&#x2c "b": 2 },90,16' "${output}"
 }
 
 mysql_upgrade_test() {