diff --git a/qa/shield-example-realm/build.gradle b/qa/shield-example-realm/build.gradle new file mode 100644 index 00000000000..debd3aa8008 --- /dev/null +++ b/qa/shield-example-realm/build.gradle @@ -0,0 +1,41 @@ +apply plugin: 'elasticsearch.esplugin' + +esplugin { + description 'a very basic implementation of a custom realm to validate it works' + classname 'org.elasticsearch.example.ExampleRealmPlugin' + isolated false +} + +dependencies { + provided project(path: ':x-plugins:license:plugin', configuration: 'runtime') + provided project(path: ':x-plugins:shield', configuration: 'runtime') +} + +compileJava.options.compilerArgs << "-Xlint:-rawtypes" +//compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" + +integTest { + cluster { + plugin 'license', project(':x-plugins:license:plugin') + plugin 'shield', project(':x-plugins:shield') + // TODO: these should be settings? + systemProperty 'es.shield.authc.realms.custom.order', '0' + systemProperty 'es.shield.authc.realms.custom.type', 'custom' + systemProperty 'es.shield.authc.realms.esusers.order', '1' + systemProperty 'es.shield.authc.realms.esusers.type', 'esusers' + + setupCommand 'setupDummyUser', + 'bin/shield/esusers', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin' + waitCondition = { node, ant -> + File tmpFile = new File(node.cwd, 'wait.success') + ant.get(src: "http://localhost:${node.httpPort()}", + dest: tmpFile.toString(), + username: 'test_user', + password: 'changeme', + ignoreerrors: true, + retries: 10) + return tmpFile.exists() + } + } +} + diff --git a/qa/shield-example-realm/integration-tests.xml b/qa/shield-example-realm/integration-tests.xml deleted file mode 100644 index e4c3afb2b37..00000000000 --- a/qa/shield-example-realm/integration-tests.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - Waiting for elasticsearch to become available on port @{port}... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Adding shield users... - - - - - - - - - - - - - - - - - - - - - Checking we can connect with basic auth on port ${integ.http.port}... - - - - -