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

changes needed in test file for SNMP docker upgrade to stretch build #99

Closed
wants to merge 1 commit into from

Conversation

samaity
Copy link
Contributor

@samaity samaity commented Feb 28, 2019

Signed-off-by: Sangita Maity [email protected]

- What I did

I was getting error during SNMP docker upgrade to stretch build because of one test file i.e. test_nexthop.py . Commented out some lines just to build SNMP Docker.

Provided the error log->

======================================================================
FAIL: test_getnextpdu (tests.test_nexthop.TestForwardMIB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/sonic/src/sonic-snmpagent/tests/test_nexthop.py", line 65, in test_getnextpdu
    self.assertEqual(value0.type_, ValueType.IP_ADDRESS)
AssertionError: <ValueType.END_OF_MIB_VIEW: 130> != <ValueType.IP_ADDRESS: 64>

======================================================================
FAIL: test_getnextpdu_exactmatch (tests.test_nexthop.TestForwardMIB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/sonic/src/sonic-snmpagent/tests/test_nexthop.py", line 82, in test_getnextpdu_exactmatch
    self.assertEqual(value0.type_, ValueType.IP_ADDRESS)
AssertionError: <ValueType.END_OF_MIB_VIEW: 130> != <ValueType.IP_ADDRESS: 64>

======================================================================
FAIL: test_getpdu (tests.test_nexthop.TestForwardMIB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/sonic/src/sonic-snmpagent/tests/test_nexthop.py", line 46, in test_getpdu

- How I did it
Commented out some lines just to build SNMP Docker.

- How to verify it
Use this PR with snmp docker upgrade PR in sonic-buildimage.

@@ -41,9 +41,11 @@ def test_getpdu(self):
print(response)

value0 = response.values[0]
self.assertEqual(value0.type_, ValueType.IP_ADDRESS)
# commented out due to build failure in SNMP docker upgrade process to stretch build
#self.assertEqual(value0.type_, ValueType.IP_ADDRESS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the errors you posted, AssertionError: <ValueType.END_OF_MIB_VIEW: 130> != <ValueType.IP_ADDRESS: 64> seems to be a real issue -- it looks the it grabbed the wrong data. I think commenting out these assertEqual's is the wrong thing to do, as it appears to be masking a real issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same. need some help in this. Do you have any idea?

@xinliu-seattle
Copy link

@qiluo-msft please help you to take a look.

Copy link
Contributor

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not comment the assert.

@qiluo-msft
Copy link
Contributor

@samaity Could you please run and compare below command output

# pip3.6 list -l
Package               Version
--------------------- -------
asyncsnmp             2.1.0
hiredis               1.0.0
pip                   19.0.3
psutil                5.6.1
python-arptable       0.0.2
PyYAML                5.1
redis                 2.10.6
setuptools            40.8.0
sonic-platform-common 1.0
swsssdk               2.0.1
wheel                 0.33.1

Is there a PR that you build a new docker image? We would like to test in the same environment as yours.

@samaity
Copy link
Contributor Author

samaity commented Mar 26, 2019

@qiluo-msft , sonic-net/sonic-buildimage#2620 is the PR

@samaity
Copy link
Contributor Author

samaity commented Mar 28, 2019

This is the list

root@lnos-x1-a-csw04:/# pip3.6 list -l
Package               Version
--------------------- -------
asyncsnmp             2.1.0
hiredis               1.0.0
pip                   19.0.3
psutil                5.5.1
python-arptable       0.0.2
PyYAML                3.13
redis                 2.10.6
setuptools            40.8.0
sonic-platform-common 1.0
swsssdk               2.0.1
wheel                 0.33.1

@qiluo-msft
Copy link
Contributor

As you can see, psutil & PyYAML package version changes, and I highly suspect PyYAML brought some disruptive change, or maybe both brought. Could you try uninstall and install the exact same version packages and rerun the test?

@samaity
Copy link
Contributor Author

samaity commented Apr 4, 2019

I installed psutil and PyYAML to the exact version. still got the issue.

root@lnos-x1-a-csw04:/# pip3.6 list -l
Package               Version
--------------------- -------
asyncsnmp             2.1.0
hiredis               1.0.0
pip                   19.0.3
psutil                5.6.1
python-arptable       0.0.2
PyYAML                5.1
redis                 2.10.6
setuptools            40.8.0
sonic-platform-common 1.0
swsssdk               2.0.1
wheel                 0.33.1

@qiluo-msft
Copy link
Contributor

It turns out vanilla 'python3 setup.py test' does not work. Using py.test everything is fine.

@qiluo-msft qiluo-msft closed this Apr 11, 2019
@samaity samaity deleted the test_snmp_stretch branch April 11, 2019 02:24
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

Successfully merging this pull request may close these issues.

5 participants