pysipp
pysipp copied to clipboard
ValueError: xml script must contain one of 'uac' or 'uas':
I am getting below error if i am trying to execute all my sipp xml files in a directory
Traceback (most recent call last): File "sipp.py", line 5, in <module> scen = pysipp.scenario(dirpath='/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR',proxyaddr=('10.204.66.84', 5080)) File "/usr/local/lib/python3.5/dist-packages/pysipp/__init__.py", line 98, in scenario **scenkwargs) File "/usr/local/lib/python3.5/dist-packages/pysipp/__init__.py", line 72, in walk .format(xml) ValueError: xml script must contain one of 'uac' or 'uas': /home/voiceqa/sipp-3.5.1/AMR_Testing/AMR/AMR_oct_modeset_1.xml
My python code look as below
import pysipp uas = pysipp.server(srcaddr=('10.204.66.84', 5080)) uac = pysipp.client(destaddr=uas.srcaddr) scen = pysipp.scenario() scen = pysipp.scenario(dirpath='/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR',proxyaddr=('10.204.66.84', 5080))
Please help me how to get rid of this problem
Hi @access2praveen. This error is saying you must have one of uac or uas in the file name for each xml script. The error could probably be made more clear. pysipp uses the file name to figure out how to launch the underlying script (as a client vs server).
Thanks, Upon prefixing scenario files with UAC, I got rid of this error , However i am seeing below error
stderr for 'uac_AMR' @ ('0.0.0.0', 33879) b'2018-08-20\t14:10:28.359428\t1534738228.359428: Missing remote host parameter. This scenario requires it.\n'
My script is written as below
import pysipp uas = pysipp.server(srcaddr=('10.204.66.84', 5080)) print(uas.srcaddr) uac = pysipp.client(destaddr=uas.srcaddr)
scen = pysipp.scenario() scen = pysipp.scenario(dirpath='/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR',proxyaddr=('10.204.66.84', 5080)) scen() pysipp.log_to_stderr('DEBUG')
Hey @access2praveen sorry about the delay getting back to you.
If you're trying to load a directory of SIPp xml scripts the pysipp.scenario() should work the best as it does a bunch of automatic socket addr configuration for you.
For this code:
scen = pysipp.scenario()
scen = pysipp.scenario(dirpath='/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR',proxyaddr=('10.204.66.84', 5080))
scen()
pysipp.log_to_stderr('DEBUG')
Before you call scen() can you run print(scen.cmditems())? This should give us a clue what might be wrong. Also note, you should put pysipp.log_to_stderr('DEBUG') before any of your other code to enable logging before calling the pysipp api.
I m seeing below message
root@voiceqa-desktop:/opt/test# python3 sipp.py ('10.204.66.84', 5080) [('uac_AMR', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '50148' -mi '0.0.0.0' -mp '45755' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_log_file' -screen_file '/tmp/uac_AMR_screen_file' -trace_logs -trace_screen "), ('uac_AMR_BW', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '49015' -mi '0.0.0.0' -mp '51162' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_BW.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_BW_log_file' -screen_file '/tmp/uac_AMR_BW_screen_file' -trace_logs -trace_screen "), ('uac_AMR_BW_modeset_0', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '49376' -mi '0.0.0.0' -mp '35203' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_BW_modeset_0.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_BW_modeset_0_log_file' -screen_file '/tmp/uac_AMR_BW_modeset_0_screen_file' -trace_logs -trace_screen "), ('uac_AMR_BW_modeset_0to7', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '34789' -mi '0.0.0.0' -mp '43847' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_BW_modeset_0to7.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_BW_modeset_0to7_log_file' -screen_file '/tmp/uac_AMR_BW_modeset_0to7_screen_file' -trace_logs -trace_screen "), ('uac_AMR_BW_modeset_2', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '42666' -mi '0.0.0.0' -mp '43551' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_BW_modeset_2.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_BW_modeset_2_log_file' -screen_file '/tmp/uac_AMR_BW_modeset_2_screen_file' -trace_logs -trace_screen "), ('uac_AMR_BW_modeset_7', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '59466' -mi '0.0.0.0' -mp '55843' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_BW_modeset_7.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_BW_modeset_7_log_file' -screen_file '/tmp/uac_AMR_BW_modeset_7_screen_file' -trace_logs -trace_screen "), ('uac_AMR_BW_modeset_8', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '60645' -mi '0.0.0.0' -mp '57396' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_BW_modeset_8.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_BW_modeset_8_log_file' -screen_file '/tmp/uac_AMR_BW_modeset_8_screen_file' -trace_logs -trace_screen "), ('uac_AMR_INTERLEAVING_EN', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '42491' -mi '0.0.0.0' -mp '33964' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_INTERLEAVING_EN.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_INTERLEAVING_EN_log_file' -screen_file '/tmp/uac_AMR_INTERLEAVING_EN_screen_file' -trace_logs -trace_screen "), ('uac_AMR_Invalid_Max-Red', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '41744' -mi '0.0.0.0' -mp '47373' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_Invalid_Max-Red.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_Invalid_Max-Red_log_file' -screen_file '/tmp/uac_AMR_Invalid_Max-Red_screen_file' -trace_logs -trace_screen "), ('uac_AMR_Negative_Max-Red', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '56083' -mi '0.0.0.0' -mp '45128' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_Negative_Max-Red.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_Negative_Max-Red_log_file' -screen_file '/tmp/uac_AMR_Negative_Max-Red_screen_file' -trace_logs -trace_screen "), ('uac_AMR_TE', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '60533' -mi '0.0.0.0' -mp '60252' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_TE.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_TE_log_file' -screen_file '/tmp/uac_AMR_TE_screen_file' -trace_logs -trace_screen "), ('uac_AMR_Valid_Max-Red', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '48985' -mi '0.0.0.0' -mp '35483' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_Valid_Max-Red.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_Valid_Max-Red_log_file' -screen_file '/tmp/uac_AMR_Valid_Max-Red_screen_file' -trace_logs -trace_screen "), ('uac_AMR_oct', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '42556' -mi '0.0.0.0' -mp '34190' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_oct.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_oct_log_file' -screen_file '/tmp/uac_AMR_oct_screen_file' -trace_logs -trace_screen "), ('uac_AMR_oct_modeset_0', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '45284' -mi '0.0.0.0' -mp '47039' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_oct_modeset_0.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_oct_modeset_0_log_file' -screen_file '/tmp/uac_AMR_oct_modeset_0_screen_file' -trace_logs -trace_screen "), ('uac_AMR_oct_modeset_0to7', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '32960' -mi '0.0.0.0' -mp '48511' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_oct_modeset_0to7.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_oct_modeset_0to7_log_file' -screen_file '/tmp/uac_AMR_oct_modeset_0to7_screen_file' -trace_logs -trace_screen "), ('uac_AMR_oct_modeset_1', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '59244' -mi '0.0.0.0' -mp '60321' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_oct_modeset_1.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_oct_modeset_1_log_file' -screen_file '/tmp/uac_AMR_oct_modeset_1_screen_file' -trace_logs -trace_screen "), ('uac_AMR_oct_modeset_2', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '48389' -mi '0.0.0.0' -mp '56393' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_oct_modeset_2.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_oct_modeset_2_log_file' -screen_file '/tmp/uac_AMR_oct_modeset_2_screen_file' -trace_logs -trace_screen "), ('uac_AMR_oct_modeset_7', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '35593' -mi '0.0.0.0' -mp '55671' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_oct_modeset_7.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_oct_modeset_7_log_file' -screen_file '/tmp/uac_AMR_oct_modeset_7_screen_file' -trace_logs -trace_screen "), ('uac_AMR_oct_modeset_8', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '58161' -mi '0.0.0.0' -mp '58903' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_oct_modeset_8.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_AMR_oct_modeset_8_log_file' -screen_file '/tmp/uac_AMR_oct_modeset_8_screen_file' -trace_logs -trace_screen "), ('uac_All_Supported_Codecs', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '54107' -mi '0.0.0.0' -mp '41651' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_All_Supported_Codecs.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_All_Supported_Codecs_log_file' -screen_file '/tmp/uac_All_Supported_Codecs_screen_file' -trace_logs -trace_screen "), ('uac_TE_AMR', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '34606' -mi '0.0.0.0' -mp '42764' -sf '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_TE_AMR.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/uac_TE_AMR_log_file' -screen_file '/tmp/uac_TE_AMR_screen_file' -trace_logs -trace_screen ")] stderr for 'uac_AMR' @ ('0.0.0.0', 50148)
Any idea about this error ?
@access2praveen I can't really diagnose this well without seeing the full logging that pysipp would normally report but it would seem that you aren't setting a remote host argument somewhere.
You have a lot of agents in this scenario so likely the problem has to do with configuring which client should make requests to which server. You'd have to give a better explanation of what this scenario is doing. Likely it's a matter of pointing all the clients to request the uas in your scenario using the .destaddr attribute.
I would say iterate through the agents on scenario and print out their cmds and .proxyaddr attribute.
Also what is the value of scenario.clientdefaults?
@access2praveen actually this might be the bug #36!
There was an open PR by @y-luis but it seems to have not gotten merged. If you can make the indentation change from #35 and it works for you then I'll redraft a PR to fix it.
@access2praveen try out #46. My initial tests seem to fix this.
Hello tgoodlet Sorry for the delayed response
The below script worked for me to execute single scenario file
import pysipp uac = pysipp.client(destaddr=('10.204.66.84',5080)) uac.local_host='10.204.66.30' uac.local_port='5030' uac.scen_file = '/home/voiceqa/sipp-3.5.1/AMR_Testing/AMR-WB/uac_AMR_BW.xml' uac()
But I want to execute all the scenarios in AMR-WB directory sequentially
Please help me to tweak my script for the same
Thanks Praveen
@access2praveen what is the error you get when trying to exec sequentially?
Hi i got the same issue as described above. If I run the above mention command and receive the following error message.
File "./sipp_test.py", line 11
uac = pysipp.client(destaddr=('192.168.2.12',5060) uac.local_host=('192.168.2.11',5060) uac.scen_file ='/home/sipp/ai_call_rtp')
^
SyntaxError: invalid syntax
My py script1 is the following:
import pysipp
uac = pysipp.client(destaddr=('192.168.2.12',5060) uac.local_host=('192.168.2.11',5060) uac.scen_file ='/home/sipp/ai_call_rtp')
#uac()
print(scen.cmditems())
My main goal would be to change the transport protocol for uas & uac to tcp and change the source and local port ip? Could you please tell me how I can do this. I tried also the following without success:
Script2:
import pysipp
scen = pysipp.scenario(dirpath='/home/sipp/ai_call_rtp',proxyaddr=('192.168.178.11', 5060))
print(scen.cmditems())
Output Script2:
[('sipp_uas_call_rtp', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '38189' -mi '0.0.0.0' -mp '56622' -sf '/home/sipp/ai_call_rtp/sipp_uas_call_rtp.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/sipp_uas_call_rtp_log_file' -screen_file '/tmp/sipp_uas_call_rtp_screen_file' -trace_logs -trace_screen "), ('sipp_uac_call_rtp', "'/usr/local/bin/sipp' -i '0.0.0.0' -p '51278' -rsa '192.168.2.11':'5060' -mi '0.0.0.0' -mp '35048' -sf '/home/sipp/ai_call_rtp/sipp_uac_call_rtp.xml' -recv_timeout '5000' -r '1' -l '1' -m '1' -log_file '/tmp/sipp_uac_call_rtp_log_file' -screen_file '/tmp/sipp_uac_call_rtp_screen_file' -trace_logs -trace_screen '0.0.0.0':'38189'")]
the scen funktion is loading both scenario files correctly but I don't know how I can replace the args values like ("-i"; "-m"; "-log_file") in the cmd command to customize my sipp request.
Would be assume if someone could help me with that.
Thanks Kallows
@Kallows I was able to do the following to override the defaults.
sipp_options={ 'call_count' : 1, 'info_file' : 'scenarios/register.csv', 'transport' : 't1', 'remote_host' : '192.168.1.1', 'remote_port': '5060' } scen = pysipp.scenario(dirpath='/home/ec2-user/did-testing/scenarios',defaults=sipp_options,proxyaddr=('192.168.1.1', 5060))