1649 Commits

Author SHA1 Message Date
Dan Williams
185e33ebe9 ipvlan: add e2e testing 2016-05-20 17:10:25 -05:00
Dan Williams
31da322f6e testutils: add e2e testing helper code 2016-05-20 17:10:25 -05:00
Dan Williams
c0d34c692f ns: add interface, use it, and fix thread-related namespace switch issues
Add a namespace object interface for somewhat cleaner code when
creating and switching between network namespaces.  All created
namespaces are now mounted in /var/run/netns to ensure they
have persistent inodes and paths that can be passed around
between plugin components without relying on the current namespace
being correct.

Also remove the thread-locking arguments from the ns package
per https://github.com/appc/cni/issues/183 by doing all the namespace
changes in a separate goroutine that locks/unlocks itself, instead of
the caller having to track OS thread locking.
2016-05-20 17:10:25 -05:00
Stefan Junker
3e1c3c60da Merge pull request #199 from dcbw/fix-bridge-tx-queue-length
bridge: leave TX queue length as kernel default, not 0
2016-05-19 23:05:08 +02:00
Stefan Junker
c019ed25d2 Merge pull request #199 from dcbw/fix-bridge-tx-queue-length
bridge: leave TX queue length as kernel default, not 0
2016-05-19 23:05:08 +02:00
Stefan Junker
d29b895932 Merge pull request #212 from squaremo/more-contrib
docs: Mention license headers and doc contributions
2016-05-19 18:38:57 +02:00
Stefan Junker
398710b3c4 Merge pull request #214 from steveeJ/merge-v0.2
Merge v0.2
2016-05-19 15:45:07 +02:00
Stefan Junker
5fa06a39f0 release script: don't run the tests
For two reasons:

1. They're not functional within rkt
2. They rebuild the binaries dynamically
2016-05-19 15:05:29 +02:00
Stefan Junker
c72dea5a20 build/release: link all release binaries statically 2016-05-19 15:05:29 +02:00
Stefan Junker
4aaffc2069 scripts: build static releases and create an ACI
* use SHA1 instead of MD5
2016-05-19 15:05:29 +02:00
Stefan Junker
e145c60337 scripts: add "release with rkt"
This script uses rkt and a fedora image to build release tarballs.
2016-05-19 15:05:29 +02:00
Michael Bridgen
bcc189e1e6 docs: Mention license headers and doc contributions
Closes #174.
2016-05-19 13:42:36 +01:00
Michael Bridgen
3738692372 Merge pull request #200 from squaremo/simplify-readme
Simplify README preamble
2016-05-19 13:21:40 +01:00
Michael Bridgen
991176a64a Merge pull request #200 from squaremo/simplify-readme
Simplify README preamble
2016-05-19 13:21:40 +01:00
Michael Bridgen
8db1f0d503 README: Simplify preamble 2016-05-19 12:52:09 +01:00
Stefan Junker
0bd4bafcda Merge pull request #175. 2016-05-19 12:08:41 +02:00
Stefan Junker
74790e55ef Merge pull request #175. 2016-05-19 12:08:41 +02:00
Angus Lees
734bf1ba5b pkg/ns: evaluate syscall number at compile-time
Previously this code used a run-time map lookup keyed by
runtime.GOOS/GOARCH.  This version uses conditional compilation to make
this choice at compile time, giving immediate feedback for unsupported
platforms.
2016-05-19 12:06:37 +02:00
Minhan Xia
5de15979c6 plugins/bridge: add support to set hairpin mode 2016-05-19 12:06:37 +02:00
Minhan Xia
89ab9299ab plugins/bridge: add support to set hairpin mode 2016-05-19 12:06:37 +02:00
Angus Lees
5978cf8b88 pkg/ns: use correct syscall number on arm 2016-05-19 12:06:37 +02:00
Dan Williams
f4eb76318e macvlan: sysctl must be set in macvlan interface's namespace
The macvlan is initially created in a separate network namespace
and the sysctl must be set in that namespace too.
2016-05-19 12:06:37 +02:00
Angus Lees
a80bcc0371 pkg/ns: evaluate syscall number at compile-time
Previously this code used a run-time map lookup keyed by
runtime.GOOS/GOARCH.  This version uses conditional compilation to make
this choice at compile time, giving immediate feedback for unsupported
platforms.
2016-05-19 12:06:37 +02:00
Angus Lees
979044ad2f pkg/ns: use correct syscall number on arm 2016-05-19 12:06:37 +02:00
Jonathan Boulle
ec78e7cf1e MAINTAINERS: add Tom Denham and Gabe Rosenhouse 2016-05-19 12:06:37 +02:00
Stefan Junker
5d67d22caa plugins/{ptp,bridge}: teardown first
This will allow the IPAM allocations to be cleared in case the
interfaces and iptables rules are non-existent.
2016-05-19 12:06:37 +02:00
Stefan Junker
b34210aa1c *: appc/cni -> containernetworking/cni
The project has been moved so internally we simply rename everything.
Consumers are recommended to update their vendored version of cni.
2016-05-19 12:06:36 +02:00
Stefan Junker
fc229c5090 *: appc/cni -> containernetworking/cni
The project has been moved so internally we simply rename everything.
Consumers are recommended to update their vendored version of cni.
2016-05-19 12:06:36 +02:00
Stefan Junker
2c482f433c *: appc/cni -> containernetworking/cni
The project has been moved so internally we simply rename everything.
Consumers are recommended to update their vendored version of cni.
2016-05-19 12:06:36 +02:00
Brandon Philips
419711fee3 README: fix badge links 2016-05-19 12:06:36 +02:00
Brandon Philips
04dbf7ce45 README: fix badges 2016-05-19 12:06:36 +02:00
Vipin Jain
61f20da4f2 README: add contiv to cni supported networking 2016-05-19 12:06:36 +02:00
Iago López Galeiras
a993ef5f7f plugins/bridge: clean masquerading rules
In the Add command we set up masquerading rules that didn't have a
corresponding clean-up code in Del.

Add the clean-up code.
2016-05-19 12:06:36 +02:00
Tom Denham
41a5dfac33 Remove reference to policy on accepting PRs
There is to policy
2016-05-19 12:06:36 +02:00
Piotr Skamruk
5cbd217cbe pkg/utils: add functions to work with sysctl 2016-05-19 12:06:16 +02:00
Piotr Skamruk
a1dab0aa40 macvlan: set proxy_arp in time of creating interface
Resolves CNI part of https://github.com/coreos/rkt/issues/1765
Second part would be adding similar lines into kvm flavored macvlan
support (in time of creating macvtap device).
2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
19850efc3a Document use of goroutine and lockosthread in test helpers 2016-05-19 12:06:16 +02:00
Piotr Skamruk
4298aa94a5 pkg/utils: add functions to work with sysctl 2016-05-19 12:06:16 +02:00
Dan Williams
5158edacef ns: fix reading net namespace in multi-threaded processes
/proc/self/ns/net gives the main thread's namespace, not necessarily
the namespace of the thread that's running the testcases.  This causes
sporadic failures of the tests.

For example, with a testcase reading inodes after switching netns:

/proc/27686/task/27689/ns/net 4026532565
/proc/self/ns/net 4026531969
/proc/27686/task/27689/ns/net 4026532565

See also:
008d17ae00

Running Suite: pkg/ns Suite
===========================
Random Seed: 1459953577
Will run 6 of 6 specs

• Failure [0.028 seconds]
Linux namespace operations
/cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:167
  WithNetNS
  /cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:166
    executes the callback within the target network namespace [It]
    /cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:97

    Expected
        <uint64>: 4026531969
    to equal
        <uint64>: 4026532565

    /cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:96
------------------------------
•••••

Summarizing 1 Failure:

[Fail] Linux namespace operations WithNetNS [It] executes the callback within the target network namespace
/cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:96

Ran 6 of 6 Specs in 0.564 seconds
FAIL! -- 5 Passed | 1 Failed | 0 Pending | 0 Skipped --- FAIL: TestNs (0.56s)
FAIL
2016-05-19 12:06:16 +02:00
Stefan Junker
d53ffe1b40 README: clarify what CNI is
The word "standard" does not represent what CNI is actually trying to
be.
2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
5260862f80 Fix issues with MakeNetworkNS test helper 2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
b5e56b3dab Document use of goroutine and lockosthread in test helpers 2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
c77f7431fb Add basic unit tests of testhelpers 2016-05-19 12:06:16 +02:00
Dan Williams
260c7f96bf ns: fix reading net namespace in multi-threaded processes
/proc/self/ns/net gives the main thread's namespace, not necessarily
the namespace of the thread that's running the testcases.  This causes
sporadic failures of the tests.

For example, with a testcase reading inodes after switching netns:

/proc/27686/task/27689/ns/net 4026532565
/proc/self/ns/net 4026531969
/proc/27686/task/27689/ns/net 4026532565

See also:
008d17ae00

Running Suite: pkg/ns Suite
===========================
Random Seed: 1459953577
Will run 6 of 6 specs

• Failure [0.028 seconds]
Linux namespace operations
/cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:167
  WithNetNS
  /cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:166
    executes the callback within the target network namespace [It]
    /cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:97

    Expected
        <uint64>: 4026531969
    to equal
        <uint64>: 4026532565

    /cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:96
------------------------------
•••••

Summarizing 1 Failure:

[Fail] Linux namespace operations WithNetNS [It] executes the callback within the target network namespace
/cni/gopath/src/github.com/appc/cni/pkg/ns/ns_test.go:96

Ran 6 of 6 Specs in 0.564 seconds
FAIL! -- 5 Passed | 1 Failed | 0 Pending | 0 Skipped --- FAIL: TestNs (0.56s)
FAIL
2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
bd7b83dd98 Extract inode inspection functions into testhelpers 2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
b09af2ff91 Fix issues with MakeNetworkNS test helper 2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
3358f16dd6 Extract testhelpers from loopback test suite 2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
1bbc87ab54 Add basic unit tests of testhelpers 2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
4fc8a90277 Extract inode inspection functions into testhelpers 2016-05-19 12:06:16 +02:00
Gabe Rosenhouse
9044dc2831 Extract testhelpers from loopback test suite 2016-05-19 12:06:16 +02:00