This is an automated email from the ASF dual-hosted git repository.
liuxun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git
The following commit(s) were added to refs/heads/master by this push:
new f9483dd SUBMARINE-524. Add travis test of commons-unixusersync
f9483dd is described below
commit f9483ddcfa578498747f5118c9e4cd56f7ec23c2
Author: Eroschang <[email protected]>
AuthorDate: Mon Jun 15 10:31:40 2020 +0800
SUBMARINE-524. Add travis test of commons-unixusersync
### What is this PR for?
To test the module of commons-unixusersync.
### What type of PR is it?
Improvement
### Todos
* [ ] - Task
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-524
### How should this be tested?
https://travis-ci.org/github/Eroschang/submarine
### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: Eroschang <[email protected]>
Closes #309 from Eroschang/SUBMARINE-524 and squashes the following commits:
c4211df [Eroschang] Test user and group from test LDAP server.
5bd1de9 [Eroschang] Test user and group from test LDAP server.
4b0a23f [Eroschang] Confirm the user name which from LDAP server.
ef17d28 [Eroschang] Confirm the user name which from LDAP server.
52a5721 [Eroschang] Add travis test of commons-unixusersync.
---
.travis.yml | 12 ++++++++++++
.../commons/unixusersync/EmbeddedLdapRuleTest.java | 16 +++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 51543c5..65ebf6f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -170,6 +170,18 @@ matrix:
- TEST_MODULES="-pl org.apache.submarine:submarine-commons-runtime"
- TEST_PROJECTS=""
+ - name: Test submarine commons-unixusersync
+ language: java
+ jdk: openjdk8
+ dist: xenial
+ env:
+ - PROFILE="-Phadoop-2.9"
+ - BUILD_FLAG="clean package install -DskipTests"
+ - TEST_FLAG="test -DskipRat -am"
+ - MODULES="-pl
${EXCLUDE_COMMONS},${EXCLUDE_SUBMITTER},${EXCLUDE_WORKBENCH},${EXCLUDE_INTERPRETER},${EXCLUDE_CLIENT},${EXCLUDE_CLOUD},${EXCLUDE_SERVER},${EXCLUDE_ALL},${EXCLUDE_DIST},${EXCLUDE_TEST}"
+ - TEST_MODULES="-pl
org.apache.submarine:submarine-commons-unixusersync"
+ - TEST_PROJECTS=""
+
- name: Test submarine server
language: java
jdk: openjdk8
diff --git
a/submarine-commons/commons-unixusersync/src/test/java/org/apache/submarine/commons/unixusersync/EmbeddedLdapRuleTest.java
b/submarine-commons/commons-unixusersync/src/test/java/org/apache/submarine/commons/unixusersync/EmbeddedLdapRuleTest.java
index ede890f..7727a8d 100644
---
a/submarine-commons/commons-unixusersync/src/test/java/org/apache/submarine/commons/unixusersync/EmbeddedLdapRuleTest.java
+++
b/submarine-commons/commons-unixusersync/src/test/java/org/apache/submarine/commons/unixusersync/EmbeddedLdapRuleTest.java
@@ -40,7 +40,9 @@ import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.StringTokenizer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -113,7 +115,19 @@ public class EmbeddedLdapRuleTest {
while (list.hasMore()){
NameClassPair nc = (NameClassPair) list.next();
- System.out.println(nc.getName());
+ String user, group = null;
+ ArrayList user_sp = new ArrayList();
+ StringTokenizer user_info = new StringTokenizer(nc.getNameInNamespace(),
",");
+
+ while (user_info.hasMoreTokens()){
+ user_sp.add(user_info.nextToken());
+ }
+ user = user_sp.get(0).toString().substring(3,
user_sp.get(0).toString().length());
+ group = user_sp.get(1).toString().substring(3,
user_sp.get(1).toString().length());
+
+ LOG.info(user);
+
+ assertEquals((user + "," + group) , "Fake-Eros,semi-people");
}
context.close();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]