Esempio n. 1
0
func (m mock) fakeAddVeth(s string) (string, error) {
	_, name := network.VethPairNames(s)
	if _, ok := m[name]; ok {
		return "", fmt.Errorf("veth exists: %s", name)
	}
	m[name] = struct{}{}
	return "tmpVeth", nil
}
Esempio n. 2
0
func (m mock) fakeDelVeth(s string) error {
	_, name := network.VethPairNames(s)
	if _, ok := m[name]; !ok {
		return fmt.Errorf("no such veth: %s", name)
	}
	delete(m, name)
	return nil
}
Esempio n. 3
0
func endpointExists(eid string) (bool, error) {
	_, name := network.VethPairNames(eid)
	return network.LinkExists("", name)
}