add_subdirectory(c)

file(GLOB PY_TEST_FILES [0-9][0-9]-*.py)
file(GLOB PY_PERSIST_TEST_FILES 15-*.py)

list(APPEND PY_TEST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/msg_sequence_test.py")

set(PERSIST_LIST
)

if(WITH_PLUGIN_PERSIST_SQLITE)
    list(APPEND PERSIST_LIST persist_sqlite)
endif()

set(EXCLUDE_LIST
    01-connect-uname-password-success-no-tls
    03-publish-qos1-queued-bytes
    03-publish-qos2-max-inflight-exceeded
    09-extended-auth-single2
    # Not a test
    06-bridge-clean-session-core
)

foreach(PY_PERSIST_TEST_FILE ${PY_PERSIST_TEST_FILES})
    get_filename_component(PY_PERSIST_TEST_NAME ${PY_PERSIST_TEST_FILE} NAME_WE)
    list(APPEND EXCLUDE_LIST ${PY_PERSIST_TEST_NAME})
endforeach()

set(PREFIX "broker-")
get_test_files(PY_TEST_FILES "${EXCLUDE_LIST}" PY_TEST_NAMES)

add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-bad-initial-packets.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-575314.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-accept-protocol.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-allow-anonymous.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "01-connect-auto-id.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-disconnect-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-global-max-clients.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-global-max-connections.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "01-connect-listener-allow-anonymous.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-max-connections.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-max-keepalive.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-take-over.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-uname-no-password-denied.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-uname-or-anon.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-uname-password-denied-no-will.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-uname-password-denied.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-unix-socket.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-connect-windows-line-endings.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "01-connect-zero-length-id.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "01-plugin-connect-uname-password-denied.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-shared-nolocal.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-shared-qos0-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subhier-crash.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-b2c-topic-alias.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-long-topic.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-oversize-payload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-queued-bytes.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-retain-as-publish.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-send-retain.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-subscription-id.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-topic-alias-unknown.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos0-topic-alias.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos1-message-expiry-retain.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos1-message-expiry-will.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos1-message-expiry.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos1-nolocal.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos1-oversize-payload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos2-1322.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos2-max-inflight-bytes.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos2-pubrec-error.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos2-receive-maximum-1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos2-receive-maximum-2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subpub-recover-subscriptions.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-dollar-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-invalid-utf8.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-long-topic.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "02-subscribe-persistence-flipflop.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-pattern-matching.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-disconnect-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-disconnect-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos1-len.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-b2c-qos2-len.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-bad-flags.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-disconnect-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-c2b-qos2-len.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-dollar-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-dollar.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-invalid-utf8.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-long-topic.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos1-max-inflight-expire.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos1-max-inflight.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos1-no-subscribers-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos1-retain-disabled.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos2-dup.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos2-max-inflight.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos2-reuse-mid.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "03-publish-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "04-retain-check-source-persist-diff-port.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-check-source-persist.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-check-source.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-clear-multiple.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-qos0-clear.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-qos0-fresh.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-qos0-repeated.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-qos0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-qos1-qos0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "04-retain-upgrade-outgoing-qos.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "05-clean-session-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "05-session-expiry-kick.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "05-session-expiry-v5.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-b2br-disconnect-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-b2br-disconnect-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-b2br-late-connection-retain.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-b2br-late-connection.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-b2br-remapping.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-br2b-disconnect-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-br2b-disconnect-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-br2b-remapping.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-clean-session-csF-lcsF.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-clean-session-csF-lcsN.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-clean-session-csF-lcsT.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-clean-session-csT-lcsF.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-clean-session-csT-lcsN.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-clean-session-csT-lcsT.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-config-reload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-fail-persist-resend-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-fail-persist-resend-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "06-bridge-no-local.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-outgoing-retain.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-per-listener-settings.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-reconnect-local-out.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-remap-receive-wildcard.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "06-bridge-remote-shutdown.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-control.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-delay-invalid-573191.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-delay-reconnect.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-delay-recover.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-delay-session-expiry.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-delay-session-expiry2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-delay-session-expiry-0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-delay.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-disconnect-with-will.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-invalid-utf8.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-no-flag.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-null-topic.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-null.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-oversize-payload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-per-listener.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-properties.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-qos0.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-reconnect-1273.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "07-will-takeover.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-bridge.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-cert-auth-crl.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-cert-auth-expired-allowed.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-cert-auth-expired.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-cert-auth-revoked.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-cert-auth-without.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-cert-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-dhparam.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-identity.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-no-auth-wrong-ca.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-no-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-ssl-connect-no-identity.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "08-ssl-hup-disconnect.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 3 "08-tls-psk-bridge.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "08-tls-psk-pub.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-acl-access-variants.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-acl-change.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-acl-empty-file.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-auth-bad-method.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-extended-auth-change-username.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-extended-auth-multistep-reauth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-extended-auth-multistep.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-extended-auth-reauth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-extended-auth-single.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-acl-access-variants.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-acl-change.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-acl-pub.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-acl-pub-prop.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-acl-sub-denied.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-acl-sub.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-context-params.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-defer-unpwd-fail.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-defer-unpwd-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-msg-params.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-unpwd-fail.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-unpwd-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v2-unpwd-fail.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v2-unpwd-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v3-unpwd-fail.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v3-unpwd-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v4-unpwd-fail.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v4-unpwd-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v5-unpwd-fail.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-auth-v5-unpwd-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-bad.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-change-id.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-delayed-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-client-offline.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-message-in.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-message-out.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-psk-key.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-reload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-subscribe.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-tick.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-evt-unsubscribe.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "09-plugin-load-acl.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 3 "09-plugin-load-basic-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "09-plugin-load-extended-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-publish.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-plugin-unsupported.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "09-pwfile-parse-invalid.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "10-listener-mount-point.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-message-expiry.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-persistence-autosave-changes.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-persistent-subscription-no-local.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-persistent-subscription.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-pub-props.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "11-subscription-id.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-assigned-client-identifier.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-maximum-packet-size-broker.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-maximum-packet-size-publish-qos1.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-maximum-packet-size-publish-qos2.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-response-topic-correlation-data.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-response-topic.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-server-keepalive.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-subpub-content-type.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "12-prop-subpub-payload-format.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "13-websocket-bad-origin.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-acl.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-allow-wildcard.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-anon-group.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-client-invalid.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-client.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-config-init-env.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-config-init-file.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-config-init-random.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-default-access.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-disable-client.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-group-invalid.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-group.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-modify-client.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-modify-group.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-modify-role.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-plugin-invalid.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-role-invalid.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "14-dynsec-role.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "16-cmd-args.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 4 "16-config-huge.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "16-config-includedir.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "16-config-missing.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "16-config-parse-errors-tls-psk.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "16-config-parse-errors-tls.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "16-config-parse-errors-without-tls.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 4 "17-control-list-listeners.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "17-control-list-plugins.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "17-control-missing-endpoint.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "20-sparkplug-aware.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "20-sparkplug-compliance.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-bad-version.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v1-bad.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v1-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-bad-config.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-bad-header.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ipv4.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ipv6.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-local.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-long-tlv.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-lost-connection.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ssl-cipher.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ssl-common-name-failure.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ssl-common-name-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ssl-require-cert-failure.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ssl-require-cert-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ssl-require-tls-failure.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-ssl-require-tls-success.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-unix.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "21-proxy-v2-websockets.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "22-http-api-acl.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 3 "22-http-api-api.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "22-http-api-auth.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "22-http-api-file.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 2 "22-http-api-tls.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "23-security-acl-file-reload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "23-security-password-file-reload.py")
add_python_test(PY_TEST_NAMES ${PREFIX} 1 "msg_sequence_test.py")

check_for_missing_tests(PY_TEST_NAMES)

foreach(PERSIST_TYPE ${PERSIST_LIST})
    foreach(PY_TEST_FILE ${PY_PERSIST_TEST_FILES})
        set(test_name "broker-${PY_TEST_NAME}-${PERSIST_TYPE}")
        get_filename_component(PY_TEST_NAME ${PY_TEST_FILE} NAME_WE)
        add_test(NAME ${test_name}
            COMMAND python3 ${PY_TEST_FILE} ${PERSIST_TYPE}
        )
        mosq_set_test_props(${test_name})
        set_tests_properties(${test_name}
            PROPERTIES
                RESOURCE_GROUPS "ports:1,ports:1"
        )
    endforeach()
endforeach()
