19 Commits

Author SHA1 Message Date
Matthieu MOREL
d12b81dec5 ci(lint): setup golangci-lint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-01 06:55:40 +00:00
liornoy
2d1005ec02
Update tests to utilize ginkgo/v2
This commit updates the import of ginkgo to v2 in
all of the tests.

Signed-off-by: liornoy <lnoy@redhat.com>
Co-authored-by: Sascha Grunert <sgrunert@redhat.com>
2023-02-13 21:15:18 +02:00
Dan Williams
5eae558a8e loopback: increase test coverage to 1.0.0 and older spec versions
Signed-off-by: Dan Williams <dcbw@redhat.com>
2021-02-11 23:27:08 -06:00
Dan Williams
839d918e35 lo: CNI_IFNAME is no longer ignored
{
    "code": 4,
    "msg": "interface name contains / or : or whitespace characters"
}

Signed-off-by: Dan Williams <dcbw@redhat.com>
2020-08-05 14:23:06 -05:00
Michael Cambria
fd42109a06 When prevResults are not returned to loopback plugin, create results to return based on
the lo interface and IP address assigned inside container.

Signed-off-by: Michael Cambria <mcambria@redhat.com>
2019-09-11 11:57:03 -04:00
smarkm
0d0dcfc02f Cleanup netns after test suit
Signed-off-by: smarkm <smark@freecoop.net>
2019-08-22 08:10:35 +08:00
Casey Callendrello
68b4efb405 plugins/* stub-out GET functions so plugins build with v0.7 2018-06-15 15:28:53 +02:00
Dan Williams
731298003c plugins/testutils: pass CNI_CONTAINERID to plugins in testcases
Recent CNI specification changes require the container ID on ADD/DEL,
which the testcases were not providing.  Fix that up so things work
when this repo gets CNI revendored.
2018-04-26 11:24:30 -05:00
Casey Callendrello
a0eac8d7d9 pkg/ns: remove namespace creation (and move to testutils)
Namespace creation had an unergonomic interface and isn't used, except
for testing code. Remove it; downstream users should really be creating
their own namespaces
2018-04-03 18:56:25 +02:00
Casey Callendrello
3c436520be move most of cni/pkg to plugins/pkg: delete code staying in cni/pkg
This moves the following packages to this repository:
* ip
* ipam
* ns
* testutils
* utils
2017-05-23 16:12:49 +02:00
Gabe Rosenhouse
fd150a4c97 skel: Plugins require a cniVersion in the NetConf 2016-09-18 21:30:57 -07: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
ed5f8dfeb2 *: 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-06 16:40:27 +02:00
Gabe Rosenhouse
5d932e4716 Extract testhelpers from loopback test suite 2016-04-17 18:28:10 -07:00
Jonathan Boulle
f6135c7ba3 *: add missing license headers + check 2016-04-01 15:35:21 +02:00
Stefan Junker
4a5426b77a tests: loopback DEL 2016-03-02 17:56:44 +01:00
Stefan Junker
80ab40470c tests: loopback stdout must be JSON 2016-03-02 15:27:05 +01:00
zachgersh
1e3d680d13 Handle namespaces with care
- After creating new netns, switch back to main netns
- Lock thread during test and test setup
2016-02-29 12:29:06 -05:00
Zachary Gershman
2708bdf2f5 Create a plugin for up'ing a lo device
- Believe we need sudo to create netns
- Use syscall instead of relying on ip netns
- Add sudo to .travis.yml
- Needs more -E
- Revert Godeps GoVersion to 1.4.2
- in travis, test command is run with all necessary env vars
- Loopback plugin only works on 'lo' interface
- Update README, add loopback plugin config
- note script dependency on jq

Signed-off-by: Gabe Rosenhouse <grosenhouse@pivotal.io>
2016-02-29 12:29:06 -05:00