]> git.ipfire.org Git - thirdparty/kea.git/commit
[#526,!269] - MySQL unit tests now wipe data, instead of schema
authorThomas Markwalder <tmark@isc.org>
Fri, 8 Mar 2019 17:06:38 +0000 (12:06 -0500)
committerThomas Markwalder <tmark@isc.org>
Fri, 8 Mar 2019 17:09:14 +0000 (12:09 -0500)
commit6af5e78ec87a98fd0980764736ffaf6a15656805
tree062a2a114c9fa583fa756d6bb70c0df392e0a8a8
parent723efb56e823194200ab00dffcbed75f2864ffaf
[#526,!269] - MySQL unit tests now wipe data, instead of schema

src/share/database/scripts/mysql/wipe_data.sh.in -
    New shell script which intelligently deletes data from
    the schema IF the schema version matches the expected version

src/lib/mysql/testutils/mysql_schema.*
    destroyMySQLSchema() - modfied to default to calling
    wipeData(), and only destroying the schema if that fails
    or by force flag = true;

    createMySQLSchema() - modified to default to calling
    wipeData(), and only recreating the schema if that
    fails or by force flag = true;

    wipeData() - new method which runs the
    MySQL wipe_data.sh shell script, passing in the expected
    schema version.

src/share/database/scripts/mysql/dhcpdb_create.mysql
    createAuditRevisionDHCP4()
    createAuditEntryDHCP4()
    createAuditRevisionDHCP6()
    createAuditEntryDHCP6() - added session variable,
    @disable_audit, to allow procedures to be "turned
    off" during data wiping.

src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_mgr_unittest.cc
src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_unittest.cc
src/lib/dhcpsrv/tests/cfg_db_access_unittest.cc
src/lib/dhcpsrv/tests/host_mgr_unittest.cc
src/lib/dhcpsrv/tests/mysql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
    Removed calls to destroy schema from test constructors
13 files changed:
configure.ac
src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_mgr_unittest.cc
src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_unittest.cc
src/lib/dhcpsrv/tests/cfg_db_access_unittest.cc
src/lib/dhcpsrv/tests/host_mgr_unittest.cc
src/lib/dhcpsrv/tests/mysql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
src/lib/mysql/testutils/mysql_schema.cc
src/lib/mysql/testutils/mysql_schema.h
src/share/database/scripts/mysql/Makefile.am
src/share/database/scripts/mysql/dhcpdb_create.mysql
src/share/database/scripts/mysql/upgrade_7.0_to_8.0.sh.in
src/share/database/scripts/mysql/wipe_data.sh.in [new file with mode: 0644]