tests: check for negative syscalls in runBpf() and skip those tests #3850

Merged
merged 1 commit into from Sep 5, 2017

Conversation

Projects
None yet
5 participants
Collaborator

mvo5 commented Sep 5, 2017

Some syscalls are resolved to negative numbers by libseccomp. An
example is the "socket" syscall which turns into -101 on i386 and
s390x on 14.04, 17.04 and 17.10.

We cannot run the unittests against a negative number so we need to
skip the unit test on these platforms for now.

This causes a FTBFS on {zesty,artful}/{i386,s390x}
apd/blob/master/CONTRIBUTING.md)?

Check for negative syscalls in runBpf() and skip those tests
Some syscalls are resolved to negative numbers by libseccomp. An
example is the "socket" syscall which turns into -101 on i386 and
s390x on 14.04, 17.04 and 17.10.

We cannot run the unittests against a negative number so we need to
skip the unit test on these platforms for now.

zyga approved these changes Sep 5, 2017

+1

@mvo5 mvo5 added this to the 2.28 milestone Sep 5, 2017

Codecov Report

Merging #3850 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3850      +/-   ##
==========================================
+ Coverage   75.71%   75.71%   +<.01%     
==========================================
  Files         413      413              
  Lines       35555    35555              
==========================================
+ Hits        26921    26922       +1     
+ Misses       6730     6729       -1     
  Partials     1904     1904
Impacted Files Coverage Δ
cmd/snap/cmd_aliases.go 95% <0%> (+1.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6a922b...d7b31c4. Read the comment docs.

@mvo5 mvo5 requested a review from jdstrand Sep 5, 2017

@mvo5 mvo5 merged commit 29180f1 into snapcore:master Sep 5, 2017

2 of 8 checks passed

artful-amd64 autopkgtest running
Details
artful-i386 autopkgtest running
Details
xenial-amd64 autopkgtest running
Details
xenial-i386 autopkgtest running
Details
yakkety-amd64 autopkgtest running
Details
zesty-amd64 autopkgtest running
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-ppc64el autopkgtest finished (success)
Details
+// can be skipped when "socketcall()" is used instead of "socket()".
+//
+// Some architectures (i386, s390x) use the "socketcall" syscall instead
+// of "socket". This is the case on Ubuntu 14.04, 17.04, 17.10
@jdstrand

jdstrand Sep 5, 2017

Contributor

17.04 and 17.10 shouldn't be using socketcall on i386 and s390x. The kernel and glibc should only be using socket and failures here would indicate a regression on those releases. Three pieces are needed, the kernel, glibc and libseccomp 2.3 for this to work. On 16.04, all this was in place-- why did this regress?

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment