On Tue, Aug 16, 2016 at 11:50 AM, Maxim Uvarov <[email protected]>
wrote:

> In docker $$ (current pid) is 1 for the first launched bash.
> 0 value in ipc .ns mixed up with NULL and not accepted.
> Also .ns value should not overflow signed int type.
>
> Signed-off-by: Maxim Uvarov <[email protected]>
>

Reviewed-and-tested-by: Bill Fischofer <[email protected]>


> ---
>  test/linux-generic/pktio_ipc/pktio_ipc_run.sh | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/test/linux-generic/pktio_ipc/pktio_ipc_run.sh
> b/test/linux-generic/pktio_ipc/pktio_ipc_run.sh
> index 2f99f32..bd64baf 100755
> --- a/test/linux-generic/pktio_ipc/pktio_ipc_run.sh
> +++ b/test/linux-generic/pktio_ipc/pktio_ipc_run.sh
> @@ -20,7 +20,10 @@ PATH=.:$PATH
>  run()
>  {
>         local ret=0
> -       IPC_NS=$$
> +       IPC_NS=`expr $$ + 5000`
> +       IPC_NS=`expr ${IPC_NS} % 65000`
> +       IPC_NS=`expr ${IPC_NS} + 2`
> +       echo "Using ns ${IPC_NS}"
>
>         #if test was interrupted with CTRL+c than files
>         #might remain in shm. Needed cleanely delete them.
> @@ -43,13 +46,17 @@ run()
>
>         if [ $ret -ne 0 ]; then
>                 echo "!!!First stage  FAILED $ret!!!"
> +               ls -l /dev/shm/
>                 exit $ret
>         else
>                 echo "First stage PASSED"
>         fi
>
> +
>         echo "==== run pktio_ipc2 then pktio_ipc1 ===="
>         IPC_NS=`expr $IPC_NS - 1`
> +       echo "Using ns ${IPC_NS}"
> +
>         pktio_ipc2${EXEEXT} -n ${IPC_NS} -t 10 &
>         IPC_PID=$!
>
> @@ -59,6 +66,7 @@ run()
>
>         if [ $ret -ne 0 ]; then
>                 echo "!!! FAILED !!!"
> +               ls -l /dev/shm/
>                 exit $ret
>         else
>                 echo "Second stage PASSED"
> --
> 2.7.1.250.gff4ea60
>
>

Reply via email to