[25/31] hadoop git commit: HADOOP-13095. hadoop-hdfs unit tests for dynamic commands

2016-05-15 Thread aw
HADOOP-13095. hadoop-hdfs unit tests for dynamic commands


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a94b33c3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a94b33c3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a94b33c3

Branch: refs/heads/HADOOP-12930
Commit: a94b33c306f1b3fefe82c063133ddfe085cbbed9
Parents: ef3072d
Author: Allen Wittenauer 
Authored: Wed May 4 20:40:39 2016 -0700
Committer: Allen Wittenauer 
Committed: Sun May 15 07:50:15 2016 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/pom.xml | 38 ++-
 .../scripts/hdfs-functions_test_helper.bash | 58 +
 .../src/test/scripts/hdfs_subcommands.bats  | 66 
 .../hadoop-hdfs/src/test/scripts/run-bats.sh| 43 +
 4 files changed, 204 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a94b33c3/hadoop-hdfs-project/hadoop-hdfs/pom.xml
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 2d534bf..3696797 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -417,7 +417,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
-  
+  
 
 
   startKdc
@@ -559,5 +559,41 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
+
+
+
+  shelltest
+  
+
+  !skipTests
+
+  
+  
+
+  
+maven-antrun-plugin
+
+
+hdfs-test-bats-driver
+test
+
+run
+
+
+  
+  
+   
+ 
+  
+
+
+
+  
+
+  
+
+
   
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a94b33c3/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
new file mode 100755
index 000..d3cdda4
--- /dev/null
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+setup() {
+
+  TMP="${BATS_TEST_DIRNAME}/../../../target/test-dir/bats.$$.${RANDOM}"
+  mkdir -p "${TMP}"
+  TMP=$(cd -P -- "${TMP}" >/dev/null && pwd -P)
+  export TMP
+  TESTBINDIR="${BATS_TEST_DIRNAME}"
+  HADOOP_LIBEXEC_DIR=${TESTBINDIR}/../../main/bin
+  HADOOP_LIBEXEC_DIR=$(cd -P -- "${HADOOP_LIBEXEC_DIR}" >/dev/null && pwd -P)
+
+  # shellcheck disable=SC2034
+  HADOOP_SHELL_SCRIPT_DEBUG=true
+  unset HADOOP_CONF_DIR
+  # we unset both of these for bw compat
+  unset HADOOP_HOME
+  unset HADOOP_PREFIX
+
+  echo "bindir: ${TESTBINDIR}" 2>&1
+
+  mkdir -p "${TMP}"
+
+  # shellcheck disable=SC2034
+  QATESTMODE=true
+
+  # shellcheck disable=SC1090
+  . 
"${BATS_TEST_DIRNAME}/../../../../../hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh"
+  pushd "${TMP}" >/dev/null
+}
+
+teardown() {
+  popd >/dev/null
+  rm -rf "${TMP}"
+}
+
+
+strstr() {
+  if [ "${1#*$2}" != "${1}" ]; then
+echo true
+  else
+echo false
+  fi
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a94b33c3/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
new file mode 100755
index 000..33fb9aa
--- 

[45/50] [abbrv] hadoop git commit: HADOOP-13095. hadoop-hdfs unit tests for dynamic commands

2016-05-12 Thread aw
HADOOP-13095. hadoop-hdfs unit tests for dynamic commands


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a894b442
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a894b442
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a894b442

Branch: refs/heads/HADOOP-12930
Commit: a894b442538e231137bb8a66ac9a7048743d8697
Parents: 4b15205
Author: Allen Wittenauer 
Authored: Wed May 4 20:40:39 2016 -0700
Committer: Allen Wittenauer 
Committed: Thu May 12 16:01:27 2016 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/pom.xml | 38 ++-
 .../scripts/hdfs-functions_test_helper.bash | 58 +
 .../src/test/scripts/hdfs_subcommands.bats  | 66 
 .../hadoop-hdfs/src/test/scripts/run-bats.sh| 43 +
 4 files changed, 204 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a894b442/hadoop-hdfs-project/hadoop-hdfs/pom.xml
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 668bbfe..c8198c1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -417,7 +417,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
-  
+  
 
 
   startKdc
@@ -559,5 +559,41 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
+
+
+
+  shelltest
+  
+
+  !skipTests
+
+  
+  
+
+  
+maven-antrun-plugin
+
+
+hdfs-test-bats-driver
+test
+
+run
+
+
+  
+  
+   
+ 
+  
+
+
+
+  
+
+  
+
+
   
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a894b442/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
new file mode 100755
index 000..d3cdda4
--- /dev/null
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+setup() {
+
+  TMP="${BATS_TEST_DIRNAME}/../../../target/test-dir/bats.$$.${RANDOM}"
+  mkdir -p "${TMP}"
+  TMP=$(cd -P -- "${TMP}" >/dev/null && pwd -P)
+  export TMP
+  TESTBINDIR="${BATS_TEST_DIRNAME}"
+  HADOOP_LIBEXEC_DIR=${TESTBINDIR}/../../main/bin
+  HADOOP_LIBEXEC_DIR=$(cd -P -- "${HADOOP_LIBEXEC_DIR}" >/dev/null && pwd -P)
+
+  # shellcheck disable=SC2034
+  HADOOP_SHELL_SCRIPT_DEBUG=true
+  unset HADOOP_CONF_DIR
+  # we unset both of these for bw compat
+  unset HADOOP_HOME
+  unset HADOOP_PREFIX
+
+  echo "bindir: ${TESTBINDIR}" 2>&1
+
+  mkdir -p "${TMP}"
+
+  # shellcheck disable=SC2034
+  QATESTMODE=true
+
+  # shellcheck disable=SC1090
+  . 
"${BATS_TEST_DIRNAME}/../../../../../hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh"
+  pushd "${TMP}" >/dev/null
+}
+
+teardown() {
+  popd >/dev/null
+  rm -rf "${TMP}"
+}
+
+
+strstr() {
+  if [ "${1#*$2}" != "${1}" ]; then
+echo true
+  else
+echo false
+  fi
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a894b442/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
new file mode 100755
index 000..33fb9aa
--- 

[13/16] hadoop git commit: HADOOP-13095. hadoop-hdfs unit tests for dynamic commands

2016-05-06 Thread aw
HADOOP-13095. hadoop-hdfs unit tests for dynamic commands


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8227d6e3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8227d6e3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8227d6e3

Branch: refs/heads/HADOOP-12930
Commit: 8227d6e30b8e2a75ed8e7fa24b355470427adf75
Parents: 311aa07
Author: Allen Wittenauer 
Authored: Wed May 4 20:40:39 2016 -0700
Committer: Allen Wittenauer 
Committed: Fri May 6 14:10:19 2016 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/pom.xml | 38 ++-
 .../scripts/hdfs-functions_test_helper.bash | 58 +
 .../src/test/scripts/hdfs_subcommands.bats  | 66 
 .../hadoop-hdfs/src/test/scripts/run-bats.sh| 43 +
 4 files changed, 204 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8227d6e3/hadoop-hdfs-project/hadoop-hdfs/pom.xml
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 668bbfe..c8198c1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -417,7 +417,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
-  
+  
 
 
   startKdc
@@ -559,5 +559,41 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
+
+
+
+  shelltest
+  
+
+  !skipTests
+
+  
+  
+
+  
+maven-antrun-plugin
+
+
+hdfs-test-bats-driver
+test
+
+run
+
+
+  
+  
+   
+ 
+  
+
+
+
+  
+
+  
+
+
   
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8227d6e3/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
new file mode 100755
index 000..d3cdda4
--- /dev/null
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+setup() {
+
+  TMP="${BATS_TEST_DIRNAME}/../../../target/test-dir/bats.$$.${RANDOM}"
+  mkdir -p "${TMP}"
+  TMP=$(cd -P -- "${TMP}" >/dev/null && pwd -P)
+  export TMP
+  TESTBINDIR="${BATS_TEST_DIRNAME}"
+  HADOOP_LIBEXEC_DIR=${TESTBINDIR}/../../main/bin
+  HADOOP_LIBEXEC_DIR=$(cd -P -- "${HADOOP_LIBEXEC_DIR}" >/dev/null && pwd -P)
+
+  # shellcheck disable=SC2034
+  HADOOP_SHELL_SCRIPT_DEBUG=true
+  unset HADOOP_CONF_DIR
+  # we unset both of these for bw compat
+  unset HADOOP_HOME
+  unset HADOOP_PREFIX
+
+  echo "bindir: ${TESTBINDIR}" 2>&1
+
+  mkdir -p "${TMP}"
+
+  # shellcheck disable=SC2034
+  QATESTMODE=true
+
+  # shellcheck disable=SC1090
+  . 
"${BATS_TEST_DIRNAME}/../../../../../hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh"
+  pushd "${TMP}" >/dev/null
+}
+
+teardown() {
+  popd >/dev/null
+  rm -rf "${TMP}"
+}
+
+
+strstr() {
+  if [ "${1#*$2}" != "${1}" ]; then
+echo true
+  else
+echo false
+  fi
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8227d6e3/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
new file mode 100755
index 000..33fb9aa
--- 

[16/28] hadoop git commit: HADOOP-13095. hadoop-hdfs unit tests for dynamic commands

2016-05-06 Thread aw
HADOOP-13095. hadoop-hdfs unit tests for dynamic commands


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e3d89a18
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e3d89a18
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e3d89a18

Branch: refs/heads/HADOOP-12930
Commit: e3d89a1886fbea48b3b1e40e04939076fda16895
Parents: 2c7aa94
Author: Allen Wittenauer 
Authored: Wed May 4 20:40:39 2016 -0700
Committer: Allen Wittenauer 
Committed: Fri May 6 08:46:54 2016 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/pom.xml | 38 ++-
 .../scripts/hdfs-functions_test_helper.bash | 58 +
 .../src/test/scripts/hdfs_subcommands.bats  | 66 
 .../hadoop-hdfs/src/test/scripts/run-bats.sh| 43 +
 4 files changed, 204 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e3d89a18/hadoop-hdfs-project/hadoop-hdfs/pom.xml
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 668bbfe..c8198c1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -417,7 +417,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
-  
+  
 
 
   startKdc
@@ -559,5 +559,41 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
+
+
+
+  shelltest
+  
+
+  !skipTests
+
+  
+  
+
+  
+maven-antrun-plugin
+
+
+hdfs-test-bats-driver
+test
+
+run
+
+
+  
+  
+   
+ 
+  
+
+
+
+  
+
+  
+
+
   
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e3d89a18/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
new file mode 100755
index 000..d3cdda4
--- /dev/null
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+setup() {
+
+  TMP="${BATS_TEST_DIRNAME}/../../../target/test-dir/bats.$$.${RANDOM}"
+  mkdir -p "${TMP}"
+  TMP=$(cd -P -- "${TMP}" >/dev/null && pwd -P)
+  export TMP
+  TESTBINDIR="${BATS_TEST_DIRNAME}"
+  HADOOP_LIBEXEC_DIR=${TESTBINDIR}/../../main/bin
+  HADOOP_LIBEXEC_DIR=$(cd -P -- "${HADOOP_LIBEXEC_DIR}" >/dev/null && pwd -P)
+
+  # shellcheck disable=SC2034
+  HADOOP_SHELL_SCRIPT_DEBUG=true
+  unset HADOOP_CONF_DIR
+  # we unset both of these for bw compat
+  unset HADOOP_HOME
+  unset HADOOP_PREFIX
+
+  echo "bindir: ${TESTBINDIR}" 2>&1
+
+  mkdir -p "${TMP}"
+
+  # shellcheck disable=SC2034
+  QATESTMODE=true
+
+  # shellcheck disable=SC1090
+  . 
"${BATS_TEST_DIRNAME}/../../../../../hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh"
+  pushd "${TMP}" >/dev/null
+}
+
+teardown() {
+  popd >/dev/null
+  rm -rf "${TMP}"
+}
+
+
+strstr() {
+  if [ "${1#*$2}" != "${1}" ]; then
+echo true
+  else
+echo false
+  fi
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e3d89a18/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
new file mode 100755
index 000..33fb9aa
--- 

[08/18] hadoop git commit: HADOOP-13095. hadoop-hdfs unit tests for dynamic commands

2016-05-04 Thread aw
HADOOP-13095. hadoop-hdfs unit tests for dynamic commands


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1df23089
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1df23089
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1df23089

Branch: refs/heads/HADOOP-12930
Commit: 1df23089e207957d70bfdf09215c1617cb1ecdcd
Parents: a48954b
Author: Allen Wittenauer 
Authored: Wed May 4 20:40:39 2016 -0700
Committer: Allen Wittenauer 
Committed: Wed May 4 20:43:21 2016 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/pom.xml | 38 ++-
 .../scripts/hdfs-functions_test_helper.bash | 58 +
 .../src/test/scripts/hdfs_subcommands.bats  | 66 
 .../hadoop-hdfs/src/test/scripts/run-bats.sh| 43 +
 4 files changed, 204 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/1df23089/hadoop-hdfs-project/hadoop-hdfs/pom.xml
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 668bbfe..c8198c1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -417,7 +417,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
-  
+  
 
 
   startKdc
@@ -559,5 +559,41 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
+
+
+
+  shelltest
+  
+
+  !skipTests
+
+  
+  
+
+  
+maven-antrun-plugin
+
+
+hdfs-test-bats-driver
+test
+
+run
+
+
+  
+  
+   
+ 
+  
+
+
+
+  
+
+  
+
+
   
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1df23089/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
new file mode 100755
index 000..d3cdda4
--- /dev/null
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+setup() {
+
+  TMP="${BATS_TEST_DIRNAME}/../../../target/test-dir/bats.$$.${RANDOM}"
+  mkdir -p "${TMP}"
+  TMP=$(cd -P -- "${TMP}" >/dev/null && pwd -P)
+  export TMP
+  TESTBINDIR="${BATS_TEST_DIRNAME}"
+  HADOOP_LIBEXEC_DIR=${TESTBINDIR}/../../main/bin
+  HADOOP_LIBEXEC_DIR=$(cd -P -- "${HADOOP_LIBEXEC_DIR}" >/dev/null && pwd -P)
+
+  # shellcheck disable=SC2034
+  HADOOP_SHELL_SCRIPT_DEBUG=true
+  unset HADOOP_CONF_DIR
+  # we unset both of these for bw compat
+  unset HADOOP_HOME
+  unset HADOOP_PREFIX
+
+  echo "bindir: ${TESTBINDIR}" 2>&1
+
+  mkdir -p "${TMP}"
+
+  # shellcheck disable=SC2034
+  QATESTMODE=true
+
+  # shellcheck disable=SC1090
+  . 
"${BATS_TEST_DIRNAME}/../../../../../hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh"
+  pushd "${TMP}" >/dev/null
+}
+
+teardown() {
+  popd >/dev/null
+  rm -rf "${TMP}"
+}
+
+
+strstr() {
+  if [ "${1#*$2}" != "${1}" ]; then
+echo true
+  else
+echo false
+  fi
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/1df23089/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
new file mode 100755
index 000..33fb9aa
--- 

hadoop git commit: HADOOP-13095. hadoop-hdfs unit tests for dynamic commands

2016-05-04 Thread aw
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12930 8092e9c7b -> 55c604517


HADOOP-13095. hadoop-hdfs unit tests for dynamic commands


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/55c60451
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/55c60451
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/55c60451

Branch: refs/heads/HADOOP-12930
Commit: 55c60451780b51987f59bef4dd0094b16a98efaa
Parents: 8092e9c
Author: Allen Wittenauer 
Authored: Wed May 4 20:40:39 2016 -0700
Committer: Allen Wittenauer 
Committed: Wed May 4 20:40:39 2016 -0700

--
 hadoop-hdfs-project/hadoop-hdfs/pom.xml | 38 ++-
 .../scripts/hdfs-functions_test_helper.bash | 58 +
 .../src/test/scripts/hdfs_subcommands.bats  | 66 
 .../hadoop-hdfs/src/test/scripts/run-bats.sh| 43 +
 4 files changed, 204 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/55c60451/hadoop-hdfs-project/hadoop-hdfs/pom.xml
--
diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml 
b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
index 668bbfe..c8198c1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml
+++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml
@@ -417,7 +417,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
-  
+  
 
 
   startKdc
@@ -559,5 +559,41 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 
   
 
+
+
+
+  shelltest
+  
+
+  !skipTests
+
+  
+  
+
+  
+maven-antrun-plugin
+
+
+hdfs-test-bats-driver
+test
+
+run
+
+
+  
+  
+   
+ 
+  
+
+
+
+  
+
+  
+
+
   
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/55c60451/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
new file mode 100755
index 000..d3cdda4
--- /dev/null
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs-functions_test_helper.bash
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+setup() {
+
+  TMP="${BATS_TEST_DIRNAME}/../../../target/test-dir/bats.$$.${RANDOM}"
+  mkdir -p "${TMP}"
+  TMP=$(cd -P -- "${TMP}" >/dev/null && pwd -P)
+  export TMP
+  TESTBINDIR="${BATS_TEST_DIRNAME}"
+  HADOOP_LIBEXEC_DIR=${TESTBINDIR}/../../main/bin
+  HADOOP_LIBEXEC_DIR=$(cd -P -- "${HADOOP_LIBEXEC_DIR}" >/dev/null && pwd -P)
+
+  # shellcheck disable=SC2034
+  HADOOP_SHELL_SCRIPT_DEBUG=true
+  unset HADOOP_CONF_DIR
+  # we unset both of these for bw compat
+  unset HADOOP_HOME
+  unset HADOOP_PREFIX
+
+  echo "bindir: ${TESTBINDIR}" 2>&1
+
+  mkdir -p "${TMP}"
+
+  # shellcheck disable=SC2034
+  QATESTMODE=true
+
+  # shellcheck disable=SC1090
+  . 
"${BATS_TEST_DIRNAME}/../../../../../hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh"
+  pushd "${TMP}" >/dev/null
+}
+
+teardown() {
+  popd >/dev/null
+  rm -rf "${TMP}"
+}
+
+
+strstr() {
+  if [ "${1#*$2}" != "${1}" ]; then
+echo true
+  else
+echo false
+  fi
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/55c60451/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats
--
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/scripts/hdfs_subcommands.bats