Comment 5 for bug 1868100

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-tempest-plugin (master)

Reviewed: https://review.opendev.org/738916
Committed: https://git.openstack.org/cgit/openstack/neutron-tempest-plugin/commit/?id=b056ac25c90b4cd8459291f1eb12081b7ace304d
Submitter: Zuul
Branch: master

commit b056ac25c90b4cd8459291f1eb12081b7ace304d
Author: Flavio Fernandes <email address hidden>
Date: Wed Jul 1 14:57:13 2020 -0400

    test_port_forwarding_to_2_servers: netcat listen stops too soon

    This change is a continuation of https://review.opendev.org/#/c/713208/

    Even with the changes from commit fd4141f2015d25f1b009d7cf2ebdd2907cd8e81a
    our tests have intermittent failures where nc listen process terminates as
    soon as the shell that spawns it closes. By (1) breaking the cmd script to
    have an extra line, (2) adding a 0.1 sec delay and (3) setting stdin of
    process the proposed changes ensures that this termination no longer
    takes place.

    In order to reproduce this issue, follow these set of steps as a reference:

    From a separate shell session in the cirros vm, watch out for nc processes

    $ watch -n1 -d "ps -elf | grep nc"

    Then, start a python session to interact with that vm via ssh session:

    $ python3

    from neutron_tempest_plugin.common import ssh
    cirros_vm_ip='10.0.0.10'
    c=ssh.Client(cirros_vm_ip, 'cirros', 'gocubsgo', port=22)
    c.execute_script('nc udp -p 12346 &')

    If you are lucky (or unlucky), you will see that there are no nc
    processes running, unless you use a variation to that command that
    looks like this:

    c.execute_script('nc udp -p 12349 &\nsleep 0')

    Than then in the watch session you will see something that look like:

    _<PID>_ cirros nc udp -p 12349

    And that will remain running even after the python session closes.

    Closes-Bug: #1868100
    Change-Id: I8192391d6f2e86f9e486805374f710444e770ea4