Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Replace file checks with whole manifest checks
Browse files Browse the repository at this point in the history
Use the newly defined check_sandbox_manifest
  • Loading branch information
datacharmer committed Sep 3, 2022
1 parent 94376b6 commit 054eab7
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 237 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.69.0
1.69.1
8 changes: 1 addition & 7 deletions ts/templates/feature/dd-expose-tables.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 1 addition & 28 deletions ts/templates/feature/multiple.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions ts/templates/feature/single-custom-credentials.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions ts/templates/feature/single.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 4 additions & 9 deletions ts/templates/feature/use-admin.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand All @@ -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
Expand Down
19 changes: 1 addition & 18 deletions ts/templates/group/group.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 1 addition & 18 deletions ts/templates/group/group_sp.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 1 addition & 18 deletions ts/templates/multi-source/all-masters.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 1 addition & 18 deletions ts/templates/multi-source/fan-in.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 1 addition & 28 deletions ts/templates/replication/replication-gtid.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 1 addition & 45 deletions ts/templates/replication/replication.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 1 addition & 28 deletions ts/templates/replication/semisync.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 054eab7

Please sign in to comment.