bstinson / centos / t_functional

Forked from centos/t_functional 4 years ago
Clone

Blame tests/p_abrt-cli/5-abrt-cli-test.sh

Matej Habrnal e4efea
#!/bin/bash
Matej Habrnal e4efea
#   Description: Verify reporter-mantisbt functionality
Matej Habrnal e4efea
#   Author: Matej Habrnal <mhabrnal@redhat.com>
Matej Habrnal e4efea
#
Matej Habrnal e4efea
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Matej Habrnal e4efea
#
Matej Habrnal e4efea
#   Copyright (c) 2011 Red Hat, Inc. All rights reserved.
Matej Habrnal e4efea
#
Matej Habrnal e4efea
#   This program is free software: you can redistribute it and/or
Matej Habrnal e4efea
#   modify it under the terms of the GNU General Public License as
Matej Habrnal e4efea
#   published by the Free Software Foundation, either version 3 of
Matej Habrnal e4efea
#   the License, or (at your option) any later version.
Matej Habrnal e4efea
#
Matej Habrnal e4efea
#   This program is distributed in the hope that it will be
Matej Habrnal e4efea
#   useful, but WITHOUT ANY WARRANTY; without even the implied
Matej Habrnal e4efea
#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
Matej Habrnal e4efea
#   PURPOSE.  See the GNU General Public License for more details.
Matej Habrnal e4efea
#
Matej Habrnal e4efea
#   You should have received a copy of the GNU General Public License
Matej Habrnal e4efea
#   along with this program. If not, see http://www.gnu.org/licenses/.
Matej Habrnal e4efea
#
Matej Habrnal e4efea
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Matej Habrnal e4efea
Matej Habrnal e4efea
TEST_DIR="tests/p_abrt-cli"
Matej Habrnal e4efea
source $TEST_DIR/_lib.sh
Matej Habrnal e4efea
Matej Habrnal e4efea
# run only on centos 7 or greater
Matej Habrnal e4efea
[[ $centos_ver -lt 7 ]] && exit
Matej Habrnal e4efea
Matej Habrnal e4efea
t_Log "Running $0 - reporter-mantisbt test suite"
Matej Habrnal e4efea
Matej Habrnal e4efea
rlJournalStart
Matej Habrnal e4efea
    rlPhaseStartSetup
Matej Habrnal e4efea
        LANG=""
Matej Habrnal e4efea
        export LANG
Matej Habrnal e4efea
Matej Habrnal e4efea
        TmpDir=$(mktemp -d)
Matej Habrnal e4efea
        cp -R $TEST_DIR/queries/* $TmpDir
Matej Habrnal e4efea
        cp -R $TEST_DIR/problem_dir $TmpDir
Matej Habrnal e4efea
        cp $TEST_DIR/_pyserve $TmpDir/pyserve
Matej Habrnal e4efea
        cp $TEST_DIR/_mantisbt.conf $TmpDir/mantisbt.conf
Matej Habrnal e4efea
        cp $TEST_DIR/_mantisbt_format.conf $TmpDir/mantisbt_format.conf
Matej Habrnal e4efea
        cp $TEST_DIR/_mantisbt_formatdup.conf $TmpDir/mantisbt_formatdup.conf
Matej Habrnal e4efea
        cp $TEST_DIR/_attachment_file $TmpDir/attachment_file
Matej Habrnal e4efea
        pushd $TmpDir
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    rlPhaseStartTest "sanity"
Matej Habrnal e4efea
        rlRun "reporter-mantisbt --help &> null"
Matej Habrnal e4efea
        rlRun "reporter-mantisbt --help 2>&1 | grep 'Usage:'"
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # search by duphash
Matej Habrnal e4efea
    # API new method for searching in MantisBT by duphas
Matej Habrnal e4efea
    rlPhaseStartTest "search by duphash"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
             login_correct \
Matej Habrnal e4efea
             search_two_issues &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -h bbfe66399cc9cb8ba647414e33c5d1e4ad82b511 -c mantisbt.conf &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login><ns3:username xsi:type=\"ns2:string\">test</ns3:username>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:password xsi:type=\"ns2:string\">password</ns3:password></ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:field xsi:type=\"ns3:ObjectRef\"><ns3:name xsi:type=\"ns2:string\">abrt_hash</ns3:name>" server_log
Matej Habrnal e4efea
        rlAssertGrep "bbfe66399cc9cb8ba647414e33c5d1e4ad82b511</ns3:item>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Looking for similar problems in CentOS Bug Tracker" client_log
Matej Habrnal e4efea
        rlAssertGrep "<item xsi:type=\"ns1:IssueData\"><id xsi:type=\"xsd:integer\">99</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "99" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # attach files to issue (parameter t, issue ID is specified)
Matej Habrnal e4efea
    rlPhaseStartTest "attach files to issue (issue ID is specified)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf \
Matej Habrnal e4efea
                -d problem_dir -t1 attachment_file &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login><ns3:username xsi:type=\"ns2:string\">test</ns3:username>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">1</ns3:issue_id>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">attachment_file</ns3:name>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:content xsi:type=\"SOAP-ENC:base64\">U1NCaGJTQmhkSFJoWTJobFpDQTZLUW89Cg==</ns3:content>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Attaching file 'attachment_file' to issue 1" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return xsi:type=\"xsd:integer\">4</return></ns1:mc_issue_attachment_addResponse>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # attach files to issue (parameter -t, issue ID is not specified)
Matej Habrnal e4efea
    # API mc_issue_attachment_add
Matej Habrnal e4efea
    rlPhaseStartTest "attach files to issue (issue ID is not specified)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlRun "echo \"CentOS Bug Tracker: URL=http://localhost:12345/mantisbt/view.php?id=1\" > problem_dir/reported_to"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -d problem_dir -t attachment_file &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">1</ns3:issue_id>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">attachment_file</ns3:name>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Attaching file 'attachment_file' to issue 1" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return xsi:type=\"xsd:integer\">4</return></ns1:mc_issue_attachment_addResponse>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # force reporting even if this problem is already reported (parameter -f)
Matej Habrnal e4efea
    rlPhaseStartTest "force reporting"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_no_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_custom_fields \
Matej Habrnal e4efea
                $QUERIES_DIR/create \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        # is reported
Matej Habrnal e4efea
        rlRun "echo \"CentOS Bug Tracker: URL=http://localhost:12345/mantisbt/view.php?id=1\" > problem_dir/reported_to"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -f -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir >client_log 2>&1 "
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        #request
Matej Habrnal e4efea
        rlAssertGrep "<ns1:Body><ns3:mc_login><ns3:username xsi:type=\"ns2:string\">test</ns3:username>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">proj</ns3:name>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:view_state xsi:type=\"ns3:ObjectRef\"><ns3:name xsi:type=\"ns2:string\">public</ns3:name></ns3:view_state>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:os_build xsi:type=\"ns2:string\">666</ns3:os_build>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:summary xsi:type=\"ns2:string\">\[abrt\] : rxvt_term::selection_delimit_word(): Process /usr/bin/urxvtd was killed by signal 11 (SIGSEGV)</ns3:summary>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">backtrace</ns3:name>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">7</ns3:issue_id>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">backtrace</ns3:name>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        #response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
        rlAssertGrep "Potential duplicate: issue 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 0 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Creating a new issue" client_log
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_addResponse><return xsi:type=\"xsd:integer\">7</return>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # create a new issue (only potential duplicate issues exist)
Matej Habrnal e4efea
    rlPhaseStartTest "create an issue (only potential duplicate issues exist)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_no_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_custom_fields \
Matej Habrnal e4efea
                $QUERIES_DIR/create \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        # is reported
Matej Habrnal e4efea
        rlRun "echo \"CentOS Bug Tracker: URL=http://localhost:12345/mantisbt/view.php?id=1\" > problem_dir/reported_to"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -f -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir >client_log 2>&1 "
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        #request
Matej Habrnal e4efea
        rlAssertGrep "<ns1:Body><ns3:mc_login><ns3:username xsi:type=\"ns2:string\">test</ns3:username>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">proj</ns3:name>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:view_state xsi:type=\"ns3:ObjectRef\"><ns3:name xsi:type=\"ns2:string\">public</ns3:name></ns3:view_state>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:os_build xsi:type=\"ns2:string\">666</ns3:os_build>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:summary xsi:type=\"ns2:string\">\[abrt\] : rxvt_term::selection_delimit_word(): Process /usr/bin/urxvtd was killed by signal 11 (SIGSEGV)</ns3:summary>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">backtrace</ns3:name>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">7</ns3:issue_id>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:name xsi:type=\"ns2:string\">backtrace</ns3:name>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        #response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
        rlAssertGrep "Potential duplicate: issue 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 0 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Creating a new issue" client_log
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_addResponse><return xsi:type=\"xsd:integer\">7</return>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Status: new http://localhost:12345/view.php?id=7" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # create a new issue (no potential duplicate issues exist)
Matej Habrnal e4efea
    rlPhaseStartTest "create an issue (no potential duplicate issues exist)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_no_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_custom_fields \
Matej Habrnal e4efea
                $QUERIES_DIR/create \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -d problem_dir &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        #request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        #response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 0 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "CentOS Bug Tracker has 2 reports" client_log #not
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Creating a new issue" client_log
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_addResponse><return xsi:type=\"xsd:integer\">7</return>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Status: new http://localhost:12345/view.php?id=7" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # duplicate issue exist (comment doesn't exist, not closed as duplicate)
Matej Habrnal e4efea
    rlPhaseStartTest "duplicate issue exist (comment doesn't exist)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_one_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_issue \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlRun "rm -f problem_dir/comment"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">99</ns3:issue_id></ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 1 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log #not
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_getResponse><return xsi:type=\"ns1:IssueData\"><id xsi:type=\"xsd:integer\">99</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">new</name></status>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Bug is already reported: 99" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # duplicate issue exist (comment doesn't exist, closed as duplicate)
Matej Habrnal e4efea
    rlPhaseStartTest "duplicate issue exist (comment doesn't exist)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_one_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_issue_closed_as_duplicate \
Matej Habrnal e4efea
                $QUERIES_DIR/get_issue \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">99</ns3:issue_id></ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 1 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_getResponse><return xsi:type=\"ns1:IssueData\"><id xsi:type=\"xsd:integer\">99</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">new</name></status>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">duplicate</name></resolution>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Bug is already reported: 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "Issue 99 is a duplicate, using parent issue 101" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Status: new open http://localhost:12345/view.php?id=101" client_log
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
        rm -f problem_dir/comment
Matej Habrnal e4efea
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # duplicate issue exist (comment file exists, isn't duplicate, attach backtrace)
Matej Habrnal e4efea
    rlPhaseStartTest "duplicate issue exist (comment file exists, isn't duplicate, attach backtrace)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_one_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/add_note \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        # create a comment file
Matej Habrnal e4efea
        rlRun "echo \"i am comment\" > problem_dir/comment"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">99</ns3:issue_id></ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_note_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 1 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log #not
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_getResponse><return xsi:type=\"ns1:IssueData\"><id xsi:type=\"xsd:integer\">99</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">new</name></status>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Bug is already reported: 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "Adding new comment to issue 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "Attaching better backtrace" client_log
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_note_addResponse><return xsi:type=\"xsd:integer\">5</return></ns1:mc_issue_note_addResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return xsi:type=\"xsd:integer\">4</return></ns1:mc_issue_attachment_addResponse>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
        rm -f problem_dir/comment
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    # duplicate issue exist (comment file exists, is duplicate)
Matej Habrnal e4efea
    rlPhaseStartTest "duplicate issue exist (comment file exists, is duplicate)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_one_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_issue_dup_comment_rating_1 \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        # create a comment file
Matej Habrnal e4efea
        rlRun "echo \"i am comment\" > problem_dir/comment"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">99</ns3:issue_id></ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 1 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_getResponse><return xsi:type=\"ns1:IssueData\"><id xsi:type=\"xsd:integer\">99</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">new</name></status>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Bug is already reported: 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "Found the same comment in the issue history, not adding a new one" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<ns1:mc_issue_note_addResponse><return xsi:type=\"xsd:integer\">5</return></ns1:mc_issue_note_addResponse>" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<return xsi:type=\"xsd:integer\">4</return></ns1:mc_issue_attachment_addResponse>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
        rm -f problem_dir/comment
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    rlPhaseStartTest "duplicate issue exist (comment file exists, isn't duplicate, the same backtrace rating)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_one_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_issue_comment_rating_1 \
Matej Habrnal e4efea
                $QUERIES_DIR/add_note \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        # create a comment file
Matej Habrnal e4efea
        rlRun "echo \"i am comment\" > problem_dir/comment"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">99</ns3:issue_id></ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_note_add>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        #not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 1 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
        rlAssertGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_getResponse><return xsi:type=\"ns1:IssueData\"><id xsi:type=\"xsd:integer\">99</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">new</name></status>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Bug is already reported: 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_note_addResponse><return xsi:type=\"xsd:integer\">5</return></ns1:mc_issue_note_addResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Adding new comment to issue 99" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertNotGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log 
Matej Habrnal e4efea
        rlAssertNotGrep "Attaching better backtrace" client_log
Matej Habrnal e4efea
        rlAsserNottGrep "Found the same comment in the issue history, not adding a new one" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<return xsi:type=\"xsd:integer\">4</return></ns1:mc_issue_attachment_addResponse>" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
        rm -f problem_dir/comment
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    rlPhaseStartTest "duplicate issue exist (comment file exists, isn't duplicate, better backtrace rating)"
Matej Habrnal e4efea
         ./pyserve \
Matej Habrnal e4efea
                $QUERIES_DIR/login_correct \
Matej Habrnal e4efea
                $QUERIES_DIR/project_get_id_from_name \
Matej Habrnal e4efea
                $QUERIES_DIR/search_two_issues \
Matej Habrnal e4efea
                $QUERIES_DIR/search_one_issue \
Matej Habrnal e4efea
                $QUERIES_DIR/get_issue_comment_rating_1 \
Matej Habrnal e4efea
                $QUERIES_DIR/add_note \
Matej Habrnal e4efea
                $QUERIES_DIR/attachment \
Matej Habrnal e4efea
                &> server_log &
Matej Habrnal e4efea
Matej Habrnal e4efea
        # create a comment file
Matej Habrnal e4efea
        rlRun "echo \"i am comment\" > problem_dir/comment"
Matej Habrnal e4efea
        rlRun "echo \"5\" > problem_dir/backtrace_rating"
Matej Habrnal e4efea
Matej Habrnal e4efea
        sleep 1
Matej Habrnal e4efea
        rlRun "reporter-mantisbt -vvv -c mantisbt.conf -F mantisbt_format.conf -A mantisbt_formatdup.conf -d problem_dir &> client_log"
Matej Habrnal e4efea
        kill %1
Matej Habrnal e4efea
Matej Habrnal e4efea
        # request
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_login>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_filter_search_issues>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:issue_id xsi:type=\"ns2:integer\">99</ns3:issue_id></ns3:mc_issue_get>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_note_add>" server_log
Matej Habrnal e4efea
        rlAssertGrep "<ns3:mc_issue_attachment_add>" server_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # response
Matej Habrnal e4efea
        rlAssertGrep "<SOAP-ENV:Body><ns1:mc_loginResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<id xsi:type=\"xsd:integer\">2</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "name xsi:type=\"xsd:string\">test</name>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Checking for duplicates" client_log
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 2 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511' including cross-version ones" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[2\]\" xsi:type=\"SOAP-ENC:Array\">" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAssertGrep "CentOS Bug Tracker has 1 reports with duphash 'bbfe66399cc9cb8ba647414e33c5d1e4ad82b511'" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<return SOAP-ENC:arrayType=\"ns1:IssueData\[0\]\" xsi:type=\"SOAP-ENC:Array\">" client_log 
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_getResponse><return xsi:type=\"ns1:IssueData\"><id xsi:type=\"xsd:integer\">99</id>" client_log
Matej Habrnal e4efea
        rlAssertGrep "<name xsi:type=\"xsd:string\">new</name></status>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Bug is already reported: 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "<ns1:mc_issue_note_addResponse><return xsi:type=\"xsd:integer\">5</return></ns1:mc_issue_note_addResponse>" client_log
Matej Habrnal e4efea
        rlAssertGrep "Adding new comment to issue 99" client_log
Matej Habrnal e4efea
        rlAssertGrep "Attaching better backtrace" client_log
Matej Habrnal e4efea
        rlAssertGrep "<return xsi:type=\"xsd:integer\">4</return></ns1:mc_issue_attachment_addResponse>" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        rlAssertGrep "Status: new open http://localhost:12345/view.php?id=99" client_log
Matej Habrnal e4efea
Matej Habrnal e4efea
        # not contain
Matej Habrnal e4efea
        rlAsserNottGrep "Found the same comment in the issue history, not adding a new one" client_log
Matej Habrnal e4efea
        rlAssertNotGrep "<int>323795</int>" client_log #dummy
Matej Habrnal e4efea
Matej Habrnal e4efea
        rm -f problem_dir/reported_to
Matej Habrnal e4efea
        rm -f problem_dir/comment
Matej Habrnal e4efea
        rlRun "echo \"1\" > problem_dir/backtrace_rating"
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
Matej Habrnal e4efea
    rlPhaseStartCleanup
Matej Habrnal e4efea
        rlBundleLogs abrt server* client*
Matej Habrnal e4efea
        popd # TmpDir
Matej Habrnal e4efea
        rm -rf $TmpDir
Matej Habrnal e4efea
    rlPhaseEnd
Matej Habrnal e4efea
    rlJournalPrintText
Matej Habrnal e4efea
rlJournalEnd