diff mbox

[ovs-dev] system-traffic: Remove DEL_NAMESPACE at ADD_NAMESPACE.

Message ID 1462399461-25568-1-git-send-email-u9012063@gmail.com
State Changes Requested
Headers show

Commit Message

William Tu May 4, 2016, 10:04 p.m. UTC
Since in ADD_NAMESPACE we've queued up namespace deletion using on_exit,
whether the test passes or fails, the namespace will be cleaned up.  So
remove the DEL_NAMESPACE before adding the namespace.

Signed-off-by: William Tu <u9012063@gmail.com>
---
 tests/system-common-macros.at | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Darrell Ball May 4, 2016, 10:36 p.m. UTC | #1
On Wed, May 4, 2016 at 3:04 PM, William Tu <u9012063@gmail.com> wrote:

> Since in ADD_NAMESPACE we've queued up namespace deletion using on_exit,
> whether the test passes or fails, the namespace will be cleaned up.  So
> remove the DEL_NAMESPACE before adding the namespace.
>
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
>  tests/system-common-macros.at | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
> index 2116f1e..f0e65d6 100644
> --- a/tests/system-common-macros.at
> +++ b/tests/system-common-macros.at
> @@ -14,8 +14,7 @@ m4_define([DEL_NAMESPACES],
>  # will be remove before new ones are installed.
>  m4_define([ADD_NAMESPACES],
>     [m4_foreach([ns], [$@],
> -               [DEL_NAMESPACES(ns)
> -                AT_CHECK([ip netns add ns || return 77])
> +               [AT_CHECK([ip netns add ns || return 77])
>

what happens if the user does CTRL+C here ?
>---------------------------------------------------------<
Will some next test(s) run will experience a leaked namespace ?

Maybe better to queue up the DEL_NAMESPACES or a
some other del version before calling "ip netns add ns"




>                  on_exit 'DEL_NAMESPACES(ns)'
>                 ])
>     ]
> --
> 2.5.0
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
diff mbox

Patch

diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
index 2116f1e..f0e65d6 100644
--- a/tests/system-common-macros.at
+++ b/tests/system-common-macros.at
@@ -14,8 +14,7 @@  m4_define([DEL_NAMESPACES],
 # will be remove before new ones are installed.
 m4_define([ADD_NAMESPACES],
    [m4_foreach([ns], [$@],
-               [DEL_NAMESPACES(ns)
-                AT_CHECK([ip netns add ns || return 77])
+               [AT_CHECK([ip netns add ns || return 77])
                 on_exit 'DEL_NAMESPACES(ns)'
                ])
    ]