diff --git a/CHANGELOG.md b/CHANGELOG.md index f93f2fb..9636186 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 1.69.1 04-Sep-2022 + +### BUGS FIXED + +* Fix error in cleanup procedure for composite sandbox + (The cleanup was not able to delete a non-empty directory) + +### Code improvements + +* Add testing command `check_sandbox_manifest`. +* Improve TestMain with a check that prevents double buildUp or early tearDown + ## 1.69.0 27-Aug-2022 ## NEW FEATURES diff --git a/common/VERSION b/common/VERSION index cb90852..79fa326 100644 --- a/common/VERSION +++ b/common/VERSION @@ -1 +1 @@ -1.69.0 \ No newline at end of file +1.69.1 \ No newline at end of file diff --git a/ts/templates/feature/dd-expose-tables.tmpl b/ts/templates/feature/dd-expose-tables.tmpl index e0459eb..4ebc9e9 100644 --- a/ts/templates/feature/dd-expose-tables.tmpl +++ b/ts/templates/feature/dd-expose-tables.tmpl @@ -22,13 +22,7 @@ cleanup_at_end $sb_dir # check files and ports -check_file $sb_dir start stop status clear -check_file $sb_dir add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir replicate_from send_kill sysbench use -check_file $sb_dir metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/data msandbox.err +check_sandbox_manifest $sb_dir single env required_ports=1 check_ports $sb_dir $required_ports diff --git a/ts/templates/feature/multiple.tmpl b/ts/templates/feature/multiple.tmpl index 2a052f6..6898595 100644 --- a/ts/templates/feature/multiple.tmpl +++ b/ts/templates/feature/multiple.tmpl @@ -12,34 +12,7 @@ stdout 'multiple directory installed in .*/sandboxes/multi_msb_{{.DbPathVer}}' exists $sb_dir cleanup_at_end $sb_dir -check_file $sb_dir metadata_all start_all sysbench_ready -check_file $sb_dir clear_all n1 status_all -check_file $sb_dir exec_all n2 replicate_from sbdescription.json stop_all test_sb_all -check_file $sb_dir n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir/node1 start stop status clear -check_file $sb_dir/node1 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node1 replicate_from send_kill sysbench use -check_file $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node1 connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/node1/data msandbox.err - -check_file $sb_dir/node2 start stop status clear -check_file $sb_dir/node2 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node2 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node2 replicate_from send_kill sysbench use -check_file $sb_dir/node2 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node2 connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/node2/data msandbox.err - -check_file $sb_dir/node3 start stop status clear -check_file $sb_dir/node3 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node3 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node3 replicate_from send_kill sysbench use -check_file $sb_dir/node3 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node3 connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/node3/data msandbox.err +check_sandbox_manifest $sb_dir multiple env required_ports=3 [version_is_at_least:$db_version:8.0.0] env required_ports=6 diff --git a/ts/templates/feature/single-custom-credentials.tmpl b/ts/templates/feature/single-custom-credentials.tmpl index e3c6099..d597e01 100644 --- a/ts/templates/feature/single-custom-credentials.tmpl +++ b/ts/templates/feature/single-custom-credentials.tmpl @@ -23,13 +23,7 @@ cleanup_at_end $sb_dir # check files and ports -check_file $sb_dir start stop status clear -check_file $sb_dir add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir replicate_from send_kill sysbench use -check_file $sb_dir metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/data msandbox.err +check_sandbox_manifest $sb_dir single env required_ports=1 [version_is_at_least:$db_version:8.0.0] env required_ports=2 diff --git a/ts/templates/feature/single.tmpl b/ts/templates/feature/single.tmpl index 4bc8d30..7f733f7 100644 --- a/ts/templates/feature/single.tmpl +++ b/ts/templates/feature/single.tmpl @@ -18,18 +18,7 @@ cleanup_at_end $sb_dir # check files and ports -check_exec $sb_dir start stop status clear -check_exec $sb_dir add_option init_db -check_exec $sb_dir show_relaylog after_start load_grants -check_exec $sb_dir replicate_from send_kill sysbench use -check_exec $sb_dir metadata restart show_binlog sysbench_ready wipe_and_restart -check_exec $sb_dir my show_log test_sb - -check_file $sb_dir connection.json connection_super_user.json connection_super_user.conf my.sandbox.cnf -check_file $sb_dir sbdescription.json connection.sql -check_file $sb_dir connection.conf grants.mysql sb_include -check_file $sb_dir/data msandbox.err -[version_is_at_least:$db_version:8.0.17] check_file $sb_dir clone_connection.sql +check_sandbox_manifest $sb_dir single env required_ports=1 [version_is_at_least:$db_version:8.0.0] env required_ports=2 diff --git a/ts/templates/feature/use-admin.tmpl b/ts/templates/feature/use-admin.tmpl index 8e3132f..ee08d2b 100644 --- a/ts/templates/feature/use-admin.tmpl +++ b/ts/templates/feature/use-admin.tmpl @@ -10,7 +10,7 @@ env db_port={{.DbIncreasedPort}} # deployment env db_dir=--sandbox-directory=msb_{{.DbPathVer}}_admin -exec dbdeployer deploy single $db_version --enable-admin-address $db_dir --port=$db_port --disable-mysqlx +exec dbdeployer deploy single $db_version --enable-admin-address $db_dir --port=$db_port stdout 'Database installed in .*/sandboxes/msb_{{.DbPathVer}}_admin' stdout 'sandbox server started' ! stderr . @@ -20,15 +20,10 @@ cleanup_at_end $sb_dir # check files and ports -check_file $sb_dir start stop status clear -check_file $sb_dir add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir replicate_from send_kill sysbench use use_admin -check_file $sb_dir metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/data msandbox.err +check_sandbox_manifest $sb_dir single +check_exec $sb_dir use_admin -env required_ports=2 +env required_ports=3 check_ports $sb_dir $required_ports exec $sb_dir/test_sb diff --git a/ts/templates/group/group.tmpl b/ts/templates/group/group.tmpl index 212fabe..ac5fe77 100644 --- a/ts/templates/group/group.tmpl +++ b/ts/templates/group/group.tmpl @@ -32,24 +32,7 @@ stdout -count=9 'ONLINE' [version_is_at_least:{{.DbVersion}}:8.0.0] stdout -count=9 'PRIMARY' ! stderr . -check_file $sb_dir check_nodes exec_all_slaves metadata_all start_all sysbench_ready use_all_masters -check_file $sb_dir clear_all initialize_nodes n1 status_all test_replication use_all_slaves -check_file $sb_dir exec_all n2 replicate_from sbdescription.json stop_all test_sb_all wipe_and_restart_all -check_file $sb_dir exec_all_masters n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir/node1 start stop status clear -check_file $sb_dir/node1 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node1 replicate_from send_kill sysbench use -check_file $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node1 connection.conf grants.mysql my sb_include show_log test_sb - -check_file $sb_dir/node3 start stop status clear -check_file $sb_dir/node3 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node3 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node3 replicate_from send_kill sysbench use -check_file $sb_dir/node3 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node3 connection.conf grants.mysql my sb_include show_log test_sb +check_sandbox_manifest $sb_dir group env required_ports=6 [version_is_at_least:$db_version:8.0.0] env required_ports=9 diff --git a/ts/templates/group/group_sp.tmpl b/ts/templates/group/group_sp.tmpl index ff20eef..fe17013 100644 --- a/ts/templates/group/group_sp.tmpl +++ b/ts/templates/group/group_sp.tmpl @@ -33,24 +33,7 @@ stdout -count=3 '[0-9]{8}-2222-2222-2222-222222222222' stdout -count=3 '[0-9]{8}-3333-3333-3333-333333333333' ! stderr . -check_file $sb_dir check_nodes exec_all_slaves metadata_all start_all sysbench_ready use_all_masters -check_file $sb_dir clear_all initialize_nodes n1 status_all test_replication use_all_slaves -check_file $sb_dir exec_all n2 replicate_from sbdescription.json stop_all test_sb_all wipe_and_restart_all -check_file $sb_dir exec_all_masters n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir/node1 start stop status clear -check_file $sb_dir/node1 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node1 replicate_from send_kill sysbench use -check_file $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node1 connection.conf grants.mysql my sb_include show_log test_sb - -check_file $sb_dir/node3 start stop status clear -check_file $sb_dir/node3 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node3 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node3 replicate_from send_kill sysbench use -check_file $sb_dir/node3 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node3 connection.conf grants.mysql my sb_include show_log test_sb +check_sandbox_manifest $sb_dir group env required_ports=6 [version_is_at_least:$db_version:8.0.0] env required_ports=9 diff --git a/ts/templates/multi-source/all-masters.tmpl b/ts/templates/multi-source/all-masters.tmpl index 2a07baa..dffed01 100644 --- a/ts/templates/multi-source/all-masters.tmpl +++ b/ts/templates/multi-source/all-masters.tmpl @@ -28,24 +28,7 @@ stdout -count=6 'Slave_IO_Running: Yes' stdout -count=6 'Slave_SQL_Running: Yes' ! stderr . -check_file $sb_dir check_ms_nodes exec_all_slaves metadata_all start_all sysbench_ready use_all_masters -check_file $sb_dir clear_all initialize_ms_nodes n1 status_all test_replication use_all_slaves -check_file $sb_dir exec_all n2 replicate_from sbdescription.json stop_all test_sb_all wipe_and_restart_all -check_file $sb_dir exec_all_masters n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir/node1 start stop status clear -check_file $sb_dir/node1 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node1 replicate_from send_kill sysbench use -check_file $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node1 connection.conf grants.mysql my sb_include show_log test_sb - -check_file $sb_dir/node3 start stop status clear -check_file $sb_dir/node3 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node3 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node3 replicate_from send_kill sysbench use -check_file $sb_dir/node3 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node3 connection.conf grants.mysql my sb_include show_log test_sb +check_sandbox_manifest $sb_dir multi_source env required_ports=3 [version_is_at_least:$db_version:8.0.0] env required_ports=6 diff --git a/ts/templates/multi-source/fan-in.tmpl b/ts/templates/multi-source/fan-in.tmpl index ff1d747..866844f 100644 --- a/ts/templates/multi-source/fan-in.tmpl +++ b/ts/templates/multi-source/fan-in.tmpl @@ -27,24 +27,7 @@ stdout -count=2 'Slave_IO_Running: Yes' stdout -count=2 'Slave_SQL_Running: Yes' ! stderr . -check_file $sb_dir check_ms_nodes exec_all_slaves metadata_all start_all sysbench_ready use_all_masters -check_file $sb_dir clear_all initialize_ms_nodes n1 status_all test_replication use_all_slaves -check_file $sb_dir exec_all n2 replicate_from sbdescription.json stop_all test_sb_all wipe_and_restart_all -check_file $sb_dir exec_all_masters n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir/node1 start stop status clear -check_file $sb_dir/node1 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node1 replicate_from send_kill sysbench use -check_file $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node1 connection.conf grants.mysql my sb_include show_log test_sb - -check_file $sb_dir/node3 start stop status clear -check_file $sb_dir/node3 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node3 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node3 replicate_from send_kill sysbench use -check_file $sb_dir/node3 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node3 connection.conf grants.mysql my sb_include show_log test_sb +check_sandbox_manifest $sb_dir multi_source env required_ports=3 [version_is_at_least:$db_version:8.0.0] env required_ports=6 diff --git a/ts/templates/replication/replication-gtid.tmpl b/ts/templates/replication/replication-gtid.tmpl index 01b224c..1feb68a 100644 --- a/ts/templates/replication/replication-gtid.tmpl +++ b/ts/templates/replication/replication-gtid.tmpl @@ -19,34 +19,7 @@ cleanup_at_end $sb_dir # check files and ports -check_file $sb_dir check_slaves exec_all_slaves metadata_all s1 start_all sysbench_ready use_all_masters -check_file $sb_dir clear_all initialize_slaves n1 s2 status_all test_replication use_all_slaves -check_file $sb_dir exec_all m n2 replicate_from sbdescription.json stop_all test_sb_all wipe_and_restart_all -check_file $sb_dir exec_all_masters n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir/master start stop status clear -check_file $sb_dir/master add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/master sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/master replicate_from send_kill sysbench use -check_file $sb_dir/master metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/master connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/master/data msandbox.err - -check_file $sb_dir/node1 start stop status clear -check_file $sb_dir/node1 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node1 replicate_from send_kill sysbench use -check_file $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node1 connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/node1/data msandbox.err - -check_file $sb_dir/node2 start stop status clear -check_file $sb_dir/node2 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node2 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node2 replicate_from send_kill sysbench use -check_file $sb_dir/node2 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node2 connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/node2/data msandbox.err +check_sandbox_manifest $sb_dir replication env required_ports=3 [version_is_at_least:$db_version:8.0.0] env required_ports=6 diff --git a/ts/templates/replication/replication.tmpl b/ts/templates/replication/replication.tmpl index 1e3505a..b3292a7 100644 --- a/ts/templates/replication/replication.tmpl +++ b/ts/templates/replication/replication.tmpl @@ -19,51 +19,7 @@ cleanup_at_end $sb_dir # check files and ports -check_exec $sb_dir check_slaves exec_all_slaves metadata_all s1 start_all sysbench_ready use_all_masters -check_exec $sb_dir clear_all initialize_slaves n1 s2 status_all test_replication use_all_slaves -check_exec $sb_dir exec_all m n2 replicate_from stop_all test_sb_all wipe_and_restart_all -check_exec $sb_dir exec_all_masters n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir sbdescription.json - -check_exec $sb_dir/master start stop status clear -check_exec $sb_dir/master add_option init_db -check_exec $sb_dir/master show_relaylog after_start load_grants -check_exec $sb_dir/master replicate_from send_kill sysbench use -check_exec $sb_dir/master metadata restart show_binlog sysbench_ready wipe_and_restart -check_exec $sb_dir/master my show_log test_sb - -check_file $sb_dir/master connection.json my.sandbox.cnf -check_file $sb_dir/master sbdescription.json connection.sql -check_file $sb_dir/master connection.conf grants.mysql connection_super_user.conf connection_super_user.json -check_file $sb_dir/master/data msandbox.err -[version_is_at_least:$db_version:8.0.17] check_file $sb_dir/master clone_connection.sql - -check_exec $sb_dir/node1 start stop status clear -check_exec $sb_dir/node1 add_option init_db -check_exec $sb_dir/node1 show_relaylog after_start load_grants -check_exec $sb_dir/node1 replicate_from send_kill sysbench use -check_exec $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_exec $sb_dir/node1 my show_log test_sb - -check_file $sb_dir/node1 connection.json my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json connection.sql -check_file $sb_dir/node1 connection.conf grants.mysql connection_super_user.conf connection_super_user.json -check_file $sb_dir/node1/data msandbox.err -[version_is_at_least:$db_version:8.0.17] check_file $sb_dir/node1 clone_connection.sql - -check_exec $sb_dir/node2 start stop status clear -check_exec $sb_dir/node2 add_option init_db -check_exec $sb_dir/node2 show_relaylog after_start load_grants -check_exec $sb_dir/node2 replicate_from send_kill sysbench use -check_exec $sb_dir/node2 metadata restart show_binlog sysbench_ready wipe_and_restart -check_exec $sb_dir/node2 my show_log test_sb - -check_file $sb_dir/node2 connection.json my.sandbox.cnf -check_file $sb_dir/node2 sbdescription.json connection.sql -check_file $sb_dir/node2 connection.conf grants.mysql connection_super_user.conf connection_super_user.json -check_file $sb_dir/node2/data msandbox.err -[version_is_at_least:$db_version:8.0.17] check_file $sb_dir/node2 clone_connection.sql +check_sandbox_manifest $sb_dir replication env required_ports=3 [version_is_at_least:$db_version:8.0.0] env required_ports=6 diff --git a/ts/templates/replication/semisync.tmpl b/ts/templates/replication/semisync.tmpl index cc06caf..2f6bd8e 100644 --- a/ts/templates/replication/semisync.tmpl +++ b/ts/templates/replication/semisync.tmpl @@ -20,34 +20,7 @@ cleanup_at_end $sb_dir # check files and ports -check_file $sb_dir check_slaves exec_all_slaves metadata_all s1 start_all sysbench_ready use_all_masters -check_file $sb_dir clear_all initialize_slaves n1 s2 status_all test_replication use_all_slaves -check_file $sb_dir exec_all m n2 replicate_from sbdescription.json stop_all test_sb_all wipe_and_restart_all -check_file $sb_dir exec_all_masters n3 restart_all send_kill_all sysbench use_all - -check_file $sb_dir/master start stop status clear -check_file $sb_dir/master add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/master sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/master replicate_from send_kill sysbench use -check_file $sb_dir/master metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/master connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/master/data msandbox.err - -check_file $sb_dir/node1 start stop status clear -check_file $sb_dir/node1 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node1 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node1 replicate_from send_kill sysbench use -check_file $sb_dir/node1 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node1 connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/node1/data msandbox.err - -check_file $sb_dir/node2 start stop status clear -check_file $sb_dir/node2 add_option connection.json init_db my.sandbox.cnf -check_file $sb_dir/node2 sbdescription.json show_relaylog after_start connection.sql load_grants -check_file $sb_dir/node2 replicate_from send_kill sysbench use -check_file $sb_dir/node2 metadata restart show_binlog sysbench_ready wipe_and_restart -check_file $sb_dir/node2 connection.conf grants.mysql my sb_include show_log test_sb -check_file $sb_dir/node2/data msandbox.err +check_sandbox_manifest $sb_dir replication env required_ports=3 [version_is_at_least:$db_version:8.0.0] env required_ports=6