This is an automated email from the ASF dual-hosted git repository. nanda pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit 8ff9578126cb97bb4958fde78a7f08c6e2b30f4b Author: Nanda kumar <[email protected]> AuthorDate: Fri Jan 25 12:14:10 2019 +0530 HDDS-1007. Add robot test for AuditParser. Contributed by Dinesh Chitlangia. --- .../src/main/smoketest/auditparser/parser.robot | 40 ++++++++++++++++++++++ hadoop-ozone/dist/src/main/smoketest/test.sh | 2 ++ 2 files changed, 42 insertions(+) diff --git a/hadoop-ozone/dist/src/main/smoketest/auditparser/parser.robot b/hadoop-ozone/dist/src/main/smoketest/auditparser/parser.robot new file mode 100644 index 0000000..2afdb5a --- /dev/null +++ b/hadoop-ozone/dist/src/main/smoketest/auditparser/parser.robot @@ -0,0 +1,40 @@ +# 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. + +*** Settings *** +Documentation Smoketest ozone cluster startup +Library OperatingSystem +Resource ../commonlib.robot + +*** Test Cases *** + +Initiating freon to generate data + ${result} = Execute ozone freon randomkeys --numOfVolumes 5 --numOfBuckets 5 --numOfKeys 5 --numOfThreads 1 + Wait Until Keyword Succeeds 3min 10sec Should contain ${result} Number of Keys added: 125 + Should Not Contain ${result} ERROR + +Testing audit parser + ${logfile} = Execute ls -t /opt/hadoop/logs | grep om-audit | head -1 + Execute ozone auditparser /opt/hadoop/audit.db load "/opt/hadoop/logs/${logfile}" + ${result} = Execute ozone auditparser /opt/hadoop/audit.db template top5cmds + Should Contain ${result} ALLOCATE_KEY + ${result} = Execute ozone auditparser /opt/hadoop/audit.db template top5users + Should Contain ${result} hadoop + ${result} = Execute ozone auditparser /opt/hadoop/audit.db query "select count(*) from audit where op='CREATE_VOLUME' and RESULT='SUCCESS'" + Should Contain ${result} 5 + ${result} = Execute ozone auditparser /opt/hadoop/audit.db query "select count(*) from audit where op='CREATE_BUCKET' and RESULT='SUCCESS'" + Should Contain ${result} 5 + ${result} = Execute ozone auditparser /opt/hadoop/audit.db query "select count(*) from audit where RESULT='FAILURE'" + Should Contain ${result} 0 diff --git a/hadoop-ozone/dist/src/main/smoketest/test.sh b/hadoop-ozone/dist/src/main/smoketest/test.sh index b447481..04f5abd 100755 --- a/hadoop-ozone/dist/src/main/smoketest/test.sh +++ b/hadoop-ozone/dist/src/main/smoketest/test.sh @@ -140,6 +140,8 @@ if [ "$RUN_ALL" = true ]; then # # We select the test suites and execute them on multiple type of clusters # + DEFAULT_TESTS=("auditparser") + execute_tests auditparser "${DEFAULT_TESTS[@]}" DEFAULT_TESTS=("security") execute_tests ozonesecure "${DEFAULT_TESTS[@]}" DEFAULT_TESTS=("basic") --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
