From 8176adfc268617d205840aeab90de75496438cf4 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 28 Jul 2017 18:04:05 +0900 Subject: [PATCH] Fix retrieve roles and users tests This commit removes the use of a now removed --path.conf command-line flag from the retrieve roles and users tests. Original commit: elastic/x-pack-elasticsearch@30d5f5f648dccdd2a36f6c5be4c733f3d42afcec --- .../authc/esnative/ESNativeMigrateToolTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java b/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java index 25ce51cd730..57f8cc4be85 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeMigrateToolTests.java @@ -69,7 +69,7 @@ public class ESNativeMigrateToolTests extends NativeRealmIntegTestCase { public void testRetrieveUsers() throws Exception { final Environment nodeEnvironment = nodeEnvironment(); String home = Environment.PATH_HOME_SETTING.get(nodeEnvironment.settings()); - String conf = nodeEnvironment.configFile().toString(); + Path conf = nodeEnvironment.configFile(); SecurityClient c = new SecurityClient(client()); logger.error("--> creating users"); int numToAdd = randomIntBetween(1,10); @@ -90,16 +90,16 @@ public class ESNativeMigrateToolTests extends NativeRealmIntegTestCase { Settings.Builder builder = Settings.builder() .put("path.home", home) - .put("path.conf", conf); + .put("path.conf", conf.toString()); SecuritySettingsSource.addSSLSettingsForStore(builder, "/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks", "testnode"); Settings settings = builder.build(); logger.error("--> retrieving users using URL: {}, home: {}", url, home); OptionParser parser = muor.getParser(); - OptionSet options = parser.parse("-u", username, "-p", password, "-U", url, "--path.conf", conf); + OptionSet options = parser.parse("-u", username, "-p", password, "-U", url); logger.info("--> options: {}", options.asMap()); - Set users = muor.getUsersThatExist(t, settings, new Environment(settings), options); + Set users = muor.getUsersThatExist(t, settings, new Environment(settings, conf), options); logger.info("--> output: \n{}", t.getOutput()); for (String u : addedUsers) { assertThat("expected list to contain: " + u + ", real list: " + users, users.contains(u), is(true)); @@ -139,7 +139,7 @@ public class ESNativeMigrateToolTests extends NativeRealmIntegTestCase { logger.error("--> retrieving roles using URL: {}, home: {}", url, home); OptionParser parser = muor.getParser(); - OptionSet options = parser.parse("-u", username, "-p", password, "-U", url, "--path.conf", conf.toString()); + OptionSet options = parser.parse("-u", username, "-p", password, "-U", url); Set roles = muor.getRolesThatExist(t, settings, new Environment(settings, conf), options); logger.info("--> output: \n{}", t.getOutput());; for (String r : addedRoles) {