Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show non-triggered accept as failed test #30

Open
igorolhovskiy opened this issue Oct 25, 2021 · 3 comments
Open

Show non-triggered accept as failed test #30

igorolhovskiy opened this issue Oct 25, 2021 · 3 comments

Comments

@igorolhovskiy
Copy link
Collaborator

As of now, construction like

<config>
    <actions>
        <action type="codec" disable="all"/>
        <action type="codec" enable="pcma" priority="250"/>
        <action type="codec" enable="pcmu" priority="249"/>
        <action type="register" label="Register 88881"
            transport="tls"
            account="88881"
            username="88881"
            password="PASS"
            registrar="DOMAIN"
            realm="DOMAIN"
            expected_cause_code="200"
        />
        <action type="wait" complete="true"/>
        <action type="accept" label="Receive all calls"
            call_count="1"
            account="88881"
            hangup="10"
            code="200" reason="OK"
            transport="tls"
        />
        <action type="call" label="Call to 88881"
            transport="tls"
            expected_cause_code="200"
            caller="88882@DOMAIN"
            callee="88881@DOMAIN"
            from="sip:88882@DOMAIN"
            to_uri="88881@DOMAIN"
            max_duration="20" hangup="16"
            username="88882"
            password="PASS"
            realm="DOMAIN"
            rtp_stats="true"
            max_ringing_duration="15"
            play="/git/voip_patrol/voice_ref_files/reference_8000_12s.wav"
        />
        <action type="wait" complete="true"/>
    </actions>
</config>

Will show 3 tests passed, if call would be received back (Register + Call + Accept) and 2 tests passed if call was not received back, but was answered elsewhere (Register + Call).

Is there any way to show accept part as FAILED test?
P.S.: I'm in the code for this, but maybe just missed something stupid.

@jchavanton
Copy link
Owner

Accept tests are only created on call reception, we would need to create failed tests on completion.

Looking at this config I would expect

We do not return until completion

<action type="wait" complete="true"/>

We need to receive at least one call

call_count="1"

Seems like wait complete is returning even if we are waiting for one call.


Based on the documentation the behavior is wrong.

"call_count : The amount of calls to receive to consider the command completed, default -1 (considered completed)"

We may have to revisit the implementation details

Example: WAIT action
wait forever:

<action type="wait" ms="-1"/>

wait until you receive a certain amount of calls

<action type="accept" call_count="x" ... />
<action type="wait" complete="true"/>

wait 5 seconds or one call

<action type="accept" call_count="1" ... />
<action type="wait" ms="5000"/>

@igorolhovskiy
Copy link
Collaborator Author

Actually, found, that regardless of call_count value, if only 1 call arrived, test considered as passed.

@igorolhovskiy
Copy link
Collaborator Author

As of now I've added to my version final report (only to JSON file for now) for number of tests completed vs number of tests actually done.
So, sort of dirty hack. Let me know if it's something could be pushed to main project as I'm continue working on tool more or less to fit my tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants