Top 4.7% dependent repos on proxy.golang.org
proxy.golang.org : github.com/thediveo/notwork
Package notwork is a tiny package that helps unit tests to create transient virtual network interfaces. It leverages vishvananda/netlink, as well as the Ginkgo testing framework with Gomega matchers. To create a transient MACVLAN network interface with a dummy-type parent network interface for the duration of a test (node): The MACVLAN and dummy network interfaces will automatically removed at the end of the test (node) they are created in, regardless of success or failure. If creating any of the virtual network interfaces fails, the test will immediately fail. Even better, don't trash around the host network namespace, but instead use a throw-away network namespace that is separate from the host network namespace. Please pay attention to the double “()()” when deferring github.com/thediveo/notwork/netns.EnterTransient. With the previous examples under our black notwork belts, let's create a VETH pair of network interfaces that connect two transient network namespaces. As for the names of the VETH pair end variables, please refer to Dupond et Dupont. Sometimes, the (RT)NETLINK API isn't enough and you need to test production code that uses information inside “/sys/class/net”. Unfortunately, sysfs is peculiar in that its network view doesn't adapt to a viewer's current network namespace. Instead, sysfs freezes the network namespace to display when it gets mounted: from then on, it shows the mounter's network namespace that the caller was attached to when issuing the mount syscall. This module thus supports creating transient mount namespaces and mounting a correct sysfs instance. This module suffers from overzealous sub-packaging.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/thediveo/notwork
License: Apache-2.0
Latest release: 8 months ago
First release: about 2 years ago
Namespace: github.com/thediveo
Dependent packages: 3
Dependent repositories: 1
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 8 days ago