From 37a7ba14ac09d43a9cd2086506f274f2fbfa3ed4 Mon Sep 17 00:00:00 2001 From: Ivan Shvedunov Date: Thu, 22 Dec 2016 11:36:09 +0300 Subject: [PATCH] Move networking tests to separate directory --- Makefile.am | 2 +- configure.ac | 2 +- tests/network/Makefile.am | 16 ++++++++++++++++ tests/network/README.md | 6 ++++++ tests/{integration => network}/dhcp_test.go | 2 +- tests/network/go.test | 3 +++ tests/{integration => network}/utils_test.go | 2 +- .../{integration => network}/vm_network_test.go | 2 +- 8 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 tests/network/Makefile.am create mode 100644 tests/network/README.md rename tests/{integration => network}/dhcp_test.go (99%) create mode 100755 tests/network/go.test rename tests/{integration => network}/utils_test.go (99%) rename tests/{integration => network}/vm_network_test.go (99%) diff --git a/Makefile.am b/Makefile.am index 2d89c84bc..e5ea16116 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ export GO15VENDOREXPERIMENT=1 export CGO_CFLAGS=$(CFLAGS) export CGO_LDFLAGS=$(LDFLAGS) $(LIBS) -SUBDIRS = pkg/bolttools pkg/download pkg/libvirttools pkg/manager pkg/nettools tests/integration +SUBDIRS = pkg/bolttools pkg/download pkg/libvirttools pkg/manager pkg/nettools tests/integration tests/network # FIXME: add back dockerfilelint.test # (as of now, it requires Docker) diff --git a/configure.ac b/configure.ac index 6a9784e79..1da8b8dd2 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,6 @@ CFLAGS="$CFLAGS $glib_CFLAGS $libvirt_CFLAGS" LDFLAGS="$LDFLAGS" LIBS="$LIBS $glib_LIBS $libvirt_LIBS" -AC_CONFIG_FILES([Makefile pkg/bolttools/Makefile pkg/download/Makefile pkg/libvirttools/Makefile pkg/manager/Makefile pkg/nettools/Makefile tests/integration/Makefile]) +AC_CONFIG_FILES([Makefile pkg/bolttools/Makefile pkg/download/Makefile pkg/libvirttools/Makefile pkg/manager/Makefile pkg/nettools/Makefile tests/integration/Makefile tests/network/Makefile]) AC_OUTPUT diff --git a/tests/network/Makefile.am b/tests/network/Makefile.am new file mode 100644 index 000000000..bc8b45b13 --- /dev/null +++ b/tests/network/Makefile.am @@ -0,0 +1,16 @@ +# Copyright 2016 Mirantis +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +check_SCRIPTS = go.test +TESTS = $(check_SCRIPTS) diff --git a/tests/network/README.md b/tests/network/README.md new file mode 100644 index 000000000..7f3a6d27f --- /dev/null +++ b/tests/network/README.md @@ -0,0 +1,6 @@ +This directory contains network tests that make use of network +namespaces and should not be mixed with non-network-namespace-aware +tests. + +For more info, see containernetworking/cni#262, vishvananda/netns#17 +etc. diff --git a/tests/integration/dhcp_test.go b/tests/network/dhcp_test.go similarity index 99% rename from tests/integration/dhcp_test.go rename to tests/network/dhcp_test.go index b4c40c73d..01189cd2e 100644 --- a/tests/integration/dhcp_test.go +++ b/tests/network/dhcp_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package integration +package network import ( "fmt" diff --git a/tests/network/go.test b/tests/network/go.test new file mode 100755 index 000000000..f7956d6d3 --- /dev/null +++ b/tests/network/go.test @@ -0,0 +1,3 @@ +#!/bin/sh + +go test -v . diff --git a/tests/integration/utils_test.go b/tests/network/utils_test.go similarity index 99% rename from tests/integration/utils_test.go rename to tests/network/utils_test.go index 911e7aab5..b6fbb71b9 100644 --- a/tests/integration/utils_test.go +++ b/tests/network/utils_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package integration +package network import ( "bytes" diff --git a/tests/integration/vm_network_test.go b/tests/network/vm_network_test.go similarity index 99% rename from tests/integration/vm_network_test.go rename to tests/network/vm_network_test.go index cd700345c..565835787 100644 --- a/tests/integration/vm_network_test.go +++ b/tests/network/vm_network_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package integration +package network import ( "bytes"