From 11814762b5cc7fda67792b95b078e10c80396bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 16 Apr 2019 20:31:41 +0300 Subject: [PATCH] MXS-1662: Test PAM admin authentication The test checks that the vagrant user has access to the REST API. --- maxscale-system-test/CMakeLists.txt | 3 +++ .../cnf/maxscale.cnf.template.mxs1662_pam_admin | 3 +++ maxscale-system-test/mxs1662_pam_admin.cpp | 15 +++++++++++++++ 3 files changed, 21 insertions(+) create mode 100755 maxscale-system-test/cnf/maxscale.cnf.template.mxs1662_pam_admin create mode 100644 maxscale-system-test/mxs1662_pam_admin.cpp diff --git a/maxscale-system-test/CMakeLists.txt b/maxscale-system-test/CMakeLists.txt index fbf9ad175..a624f7719 100644 --- a/maxscale-system-test/CMakeLists.txt +++ b/maxscale-system-test/CMakeLists.txt @@ -943,6 +943,9 @@ add_test_executable(mxs2313_rank.cpp mxs2313_rank mxs2313_rank LABELS readwrites # MXS-2417: Ignore persisted configs with load_persisted_configs=false add_test_executable(mxs2417_ignore_persisted_cnf.cpp mxs2417_ignore_persisted_cnf mxs2417_ignore_persisted_cnf LABELS REPL_BACKEND) +# MXS-1662: PAM admin authentication +add_test_executable(mxs1662_pam_admin.cpp mxs1662_pam_admin mxs1662_pam_admin LABELS REPL_BACKEND) + ############################################ # BEGIN: binlogrouter and avrorouter tests # ############################################ diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs1662_pam_admin b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1662_pam_admin new file mode 100755 index 000000000..6d016e412 --- /dev/null +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1662_pam_admin @@ -0,0 +1,3 @@ +[maxscale] +threads=###threads### +admin_pam_readwrite_service=passwd diff --git a/maxscale-system-test/mxs1662_pam_admin.cpp b/maxscale-system-test/mxs1662_pam_admin.cpp new file mode 100644 index 000000000..920251b56 --- /dev/null +++ b/maxscale-system-test/mxs1662_pam_admin.cpp @@ -0,0 +1,15 @@ +/** + * MXS-1662: PAM authenticator for admin users + */ + +#include "testconnections.h" + +int main(int argc, char** argv) +{ + TestConnections test(argc, argv); + + // TODO: Store login information + test.check_maxctrl("-u vagrant -p vagrant show maxscale"); + + return test.global_result; +}