HADOOP-10244. TestKeyShell improperly tests the results of delete (Larry

McCay via omalley)


Conflicts:
	hadoop-common-project/hadoop-common/CHANGES.txt

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1619514 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2014-08-21 18:58:40 +00:00
parent e0729c3871
commit 32134d7386
2 changed files with 10 additions and 7 deletions

View File

@ -202,6 +202,9 @@ Release 2.6.0 - UNRELEASED
HADOOP-10237. JavaKeyStoreProvider needs to set keystore permissions HADOOP-10237. JavaKeyStoreProvider needs to set keystore permissions
correctly. (Larry McCay via omalley) correctly. (Larry McCay via omalley)
HADOOP-10244. TestKeyShell improperly tests the results of delete (Larry
McCay via omalley)
Release 2.5.0 - 2014-08-11 Release 2.5.0 - 2014-08-11
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -41,7 +41,7 @@ public class TestKeyShell {
@Test @Test
public void testKeySuccessfulKeyLifecycle() throws Exception { public void testKeySuccessfulKeyLifecycle() throws Exception {
outContent.flush(); outContent.reset();
String[] args1 = {"create", "key1", "--provider", String[] args1 = {"create", "key1", "--provider",
"jceks://file" + tmpDir + "/keystore.jceks"}; "jceks://file" + tmpDir + "/keystore.jceks"};
int rc = 0; int rc = 0;
@ -52,14 +52,14 @@ public class TestKeyShell {
assertTrue(outContent.toString().contains("key1 has been successfully " + assertTrue(outContent.toString().contains("key1 has been successfully " +
"created.")); "created."));
outContent.flush(); outContent.reset();
String[] args2 = {"list", "--provider", String[] args2 = {"list", "--provider",
"jceks://file" + tmpDir + "/keystore.jceks"}; "jceks://file" + tmpDir + "/keystore.jceks"};
rc = ks.run(args2); rc = ks.run(args2);
assertEquals(0, rc); assertEquals(0, rc);
assertTrue(outContent.toString().contains("key1")); assertTrue(outContent.toString().contains("key1"));
outContent.flush(); outContent.reset();
String[] args3 = {"roll", "key1", "--provider", String[] args3 = {"roll", "key1", "--provider",
"jceks://file" + tmpDir + "/keystore.jceks"}; "jceks://file" + tmpDir + "/keystore.jceks"};
rc = ks.run(args3); rc = ks.run(args3);
@ -67,7 +67,7 @@ public class TestKeyShell {
assertTrue(outContent.toString().contains("key1 has been successfully " + assertTrue(outContent.toString().contains("key1 has been successfully " +
"rolled.")); "rolled."));
outContent.flush(); outContent.reset();
String[] args4 = {"delete", "key1", "--provider", String[] args4 = {"delete", "key1", "--provider",
"jceks://file" + tmpDir + "/keystore.jceks"}; "jceks://file" + tmpDir + "/keystore.jceks"};
rc = ks.run(args4); rc = ks.run(args4);
@ -75,12 +75,12 @@ public class TestKeyShell {
assertTrue(outContent.toString().contains("key1 has been successfully " + assertTrue(outContent.toString().contains("key1 has been successfully " +
"deleted.")); "deleted."));
outContent.flush(); outContent.reset();
String[] args5 = {"list", "--provider", String[] args5 = {"list", "--provider",
"jceks://file" + tmpDir + "/keystore.jceks"}; "jceks://file" + tmpDir + "/keystore.jceks"};
rc = ks.run(args5); rc = ks.run(args5);
assertEquals(0, rc); assertEquals(0, rc);
assertTrue(outContent.toString().contains("key1")); assertFalse(outContent.toString(), outContent.toString().contains("key1"));
} }
@Test @Test
@ -165,7 +165,7 @@ public class TestKeyShell {
assertTrue(outContent.toString().contains("key1 has been successfully " + assertTrue(outContent.toString().contains("key1 has been successfully " +
"created.")); "created."));
outContent.flush(); outContent.reset();
String[] args2 = {"delete", "key1", "--provider", String[] args2 = {"delete", "key1", "--provider",
"jceks://file" + tmpDir + "/keystore.jceks"}; "jceks://file" + tmpDir + "/keystore.jceks"};
rc = ks.run(args2); rc = ks.run(args2);