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

Skip intel1g selftest if SNABB_PCI_INTEL1G0 is empty #975

Merged
merged 2 commits into from
Aug 3, 2016

Conversation

dpino
Copy link
Contributor

@dpino dpino commented Jul 28, 2016

Recently we updated our lwaftr branch with Snabb master. Since then snabb-bot CI tests are failing on intel1g selftest. Example: https://gist.github.com/lwaftr-igalia/8d3a39922142575d10dae99027e108fd

The reason is that snabb-bot runs the tests as:

nix/store/zjvf7la6my2pqshyaz71h1n9icx3bvw8-docker-1.8.1/libexec/docker/docker run \
--rm --privileged -i -v /tmp/snabb_bot/tmp/repo:/snabb -e SNABB_PCI0=0000:83:00.0 \
 -e SNABB_PCI1=0000:83:00.1 -e SNABB_PCI_INTEL0= -e SNABB_PCI_INTEL1= \
 -e SNABB_PCI_INTEL1G0= -e SNABB_PCI_INTEL1G1= -e \
SNABB_PCI_SOLARFLARE0= -e SNABB_PCI_SOLARFLARE1= -e \
SNABB_TELNET0= -e SNABB_TELNET1= -e SNABB_PCAP= -e \
SNABB_PERF_SAMPLESIZE=5 lwaftr/snabb-test \
bash -c mount -t hugetlbfs none /hugetlbfs && (cd snabb/src; make benchmarks)

SNABB_PCI_INTEL1G0 is set but its value is empty. The test is only skipped if SNABB_PCI_INTEL1G0 doesn't exist.

The failing test is reproducible in master:

$ sudo SNABB_PCI_INTEL1G0= ./snabb snsh -t apps.intel.intel1g
selftest: Intel1g
core/lib.lua:60: Unable to open file: /sys/bus/pci/devices//vendor
stack traceback:
        core/main.lua:130: in function <core/main.lua:128>
        [C]: in function 'error'
        core/lib.lua:60: in function 'firstline'
        lib/hardware/pci.lua:40: in function 'device_info'
        apps/intel/intel1g.lua:94: in function 'new'

The test should be skipped too when the variable exists and its value is empty.

Skip selftest if SNABB_PCI_INTEL1G0 is empty.
@eugeneia eugeneia self-assigned this Jul 28, 2016
@eugeneia
Copy link
Member

There is lib.getenv for that purpose, so you don't have to do that check ad-hoc.

@dpino
Copy link
Contributor Author

dpino commented Jul 29, 2016

Thanks @eugeneia. Fixed.

@eugeneia eugeneia merged commit bf09217 into snabbco:master Aug 3, 2016
@dpino dpino deleted the fix-intel1g-selftest branch September 8, 2016 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants