OpenIxia / ixnetwork_restpy

The IxNetwork python client.
https://openixia.github.io/ixnetwork_restpy/#/
MIT License
30 stars 16 forks source link

Rfc2544throughput QuickTest TestConfig() More Than 255 Arguments Error #28

Open ATSVTtest opened 4 years ago

ATSVTtest commented 4 years ago

When attempting to generate a TestConfig object from a Rfc2544throughput object a SyntaxError is generated:

>>> ixSession.Ixnetwork.QuickTest.Rfc2544throughput.add().TestConfig()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/haydnb/svt_scripts/3007_ixnetwork/ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/rfc2544throughput_2993ee9d3aa1842ea5cbff3edf8a2923.py", line 92, in TestConfig
    from ixnetwork_restpy.testplatform.sessions.ixnetwork.quicktest.testconfig_81b75f11abcc4096f93d5a7b6bf03b10 import TestConfig
  File "/home/haydnb/svt_scripts/3007_ixnetwork/ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/testconfig_81b75f11abcc4096f93d5a7b6bf03b10.py", line 3517
    tep_latency_scaleAccLoss=None, Step_step_latency_thresholdAccLoss=None, Step_step_peak_FrameLossUnit=None, Step_step_peak_initialValue=None, Step_step_peak_maxValue=None, Step_step_peak_stepTolerance=None, Step_step_peak_stepValue=None, Step_step_seq_enableAccLoss=None, Step_step_seq_modeAccLoss=None, Step_step_seq_thresholdAccLoss=None, StopTestOnHighLoss=None, SupportedTrafficTypes=None, Tolerance=None, TrafficType=None, TxDelay=None, UnchangedInitial=None, UnchangedValueList=None, UsePercentOffsets=None, UseTiLoss=None):
                  ^
SyntaxError: more than 255 arguments
>>>

Other quicktests do not thave this problem. For example: QuickTest.Rfc3918scaleGroup.add().TestConfig() returns successfully.

See the following output from a python3 shell:

Python 3.4.3 (default, Nov 12 2018, 22:25:49)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ixnetwork_restpy import SessionAssistant, Files
>>> ixnetworkAPIServerIP = "192.168.1.1"
>>> ixnetworkAPIServerRestPort = 11009
>>> ixSession = SessionAssistant(IpAddress=ixnetworkAPIServerIP, RestPort = ixnetworkAPIServerRestPort, ClearConfig=True, LogFilename='restpy.log')
>>> ixn = ixSession.Ixnetwork
>>> qt=ixn.QuickTest.Rfc2544throughput.add()
>>> type(qt)
<class 'ixnetwork_restpy.testplatform.sessions.ixnetwork.quicktest.rfc2544throughput_2993ee9d3aa1842ea5cbff3edf8a2923.Rfc2544throughput'>
>>> qtTc = qt.TestConfig()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/rfc2544throughput_2993ee9d3aa1842ea5cbff3edf8a2923.py", line 92, in TestConfig
    from ixnetwork_restpy.testplatform.sessions.ixnetwork.quicktest.testconfig_81b75f11abcc4096f93d5a7b6bf03b10 import TestConfig
  File "/ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/testconfig_81b75f11abcc4096f93d5a7b6bf03b10.py", line 3517
    tep_latency_scaleAccLoss=None, Step_step_latency_thresholdAccLoss=None, Step_step_peak_FrameLossUnit=None, Step_step_peak_initialValue=None, Step_step_peak_maxValue=None, Step_step_peak_stepTolerance=None, Step_step_peak_stepValue=None, Step_step_seq_enableAccLoss=None, Step_step_seq_modeAccLoss=None, Step_step_seq_thresholdAccLoss=None, StopTestOnHighLoss=None, SupportedTrafficTypes=None, Tolerance=None, TrafficType=None, TxDelay=None, UnchangedInitial=None, UnchangedValueList=None, UsePercentOffsets=None, UseTiLoss=None):
                  ^
SyntaxError: more than 255 arguments
ajbalogh commented 4 years ago

.TestConfig is an property not a method. It returns a TestConfig object with the encapsulated resource.

assistant = SessionAssistant( IpAddress='10.36.66.49', RestPort=11009,

SessionId=1,

LogLevel=SessionAssistant.LOGLEVEL_INFO,
ClearConfig=True)

ixNetwork = assistant.Ixnetwork

rfc2544 = ixNetwork.QuickTest.Rfc2544throughput.add() test_config = rfc2544.TestConfig print(test_config)

ATSVTtest commented 4 years ago

The error still occurs whether .TestConfig is treated as a property or a method.

Python 3.4.3 (default, Nov 12 2018, 22:25:49)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ixnetwork_restpy import SessionAssistant
>>> assistant = SessionAssistant(IpAddress='192.168.1.1',RestPort=11009,LogLevel=SessionAssistant.LOGLEVEL_INFO,ClearConfig=True)
2020-08-20 05:19:02 [ixnetwork_restpy.connection] [INFO] using python version 3.4.3 (default, Nov 12 2018, 22:25:49)
[GCC 4.8.4]
2020-08-20 05:19:02 [ixnetwork_restpy.connection] [INFO] using ixnetwork-restpy version 1.0.51
2020-08-20 05:19:02 [ixnetwork_restpy.connection] [WARNING] Verification of certificates is disabled
2020-08-20 05:19:02 [ixnetwork_restpy.connection] [INFO] The package will automatically determine the test tool platform and rest_port using the 192.168.1.1 address.
2020-08-20 05:19:02 [ixnetwork_restpy.connection] [INFO] Connection established to `http://192.168.1.1:11009 on windows`
>>> ixNetwork = assistant.Ixnetwork
>>> rfc2544 = ixNetwork.QuickTest.Rfc2544throughput.add()
>>> test_config = rfc2544.TestConfig
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/rfc2544throughput_2993ee9d3aa1842ea5cbff3edf8a2923.py", line 92, in TestConfig
    from ixnetwork_restpy.testplatform.sessions.ixnetwork.quicktest.testconfig_81b75f11abcc4096f93d5a7b6bf03b10 import TestConfig
  File "/ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/testconfig_81b75f11abcc4096f93d5a7b6bf03b10.py", line 3517
    tep_latency_scaleAccLoss=None, Step_step_latency_thresholdAccLoss=None, Step_step_peak_FrameLossUnit=None, Step_step_peak_initialValue=None, Step_step_peak_maxValue=None, Step_step_peak_stepTolerance=None, Step_step_peak_stepValue=None, Step_step_seq_enableAccLoss=None, Step_step_seq_modeAccLoss=None, Step_step_seq_thresholdAccLoss=None, StopTestOnHighLoss=None, SupportedTrafficTypes=None, Tolerance=None, TrafficType=None, TxDelay=None, UnchangedInitial=None, UnchangedValueList=None, UsePercentOffsets=None, UseTiLoss=None):
                  ^
SyntaxError: more than 255 arguments
ajbalogh commented 4 years ago

Versions of python prior to 3.7 do not support more than 255 args. The ixnetwork team will be updating the class generator to replace those cases where args > 255 with **kwargs.