HPENetworking / topology_docker

Docker based Platform Engine plugin for the Topology Modular Framework
https://topology-docker.readthedocs.io/
Apache License 2.0
2 stars 15 forks source link

The openswitch node should stop vtysh gracefully #15

Closed walintonc closed 8 years ago

walintonc commented 8 years ago

It looks like today after having processed all vtysh commands, the vtysh session isn't ended properly (i.e with 'exit').

I am trying to measure code coverage (gcov) and need the vtysh binary to gracefully end after having executed all my tests.

carlos-jenkins commented 8 years ago

This should be responsibility of the OpenSwitch support node.

Maybe sending the exit command on __del__ here:

https://github.com/HPENetworking/topology_docker/blob/master/lib/topology_docker/nodes/openswitch.py#L242

Something like:

def __del__(self):
    self._shells['vtysh'].send_command('exit', matches=[BASH_PROMPT])

I'm assuming the send_command API for shell available in topology_connect: https://github.com/HPENetworking/topology_connect/blob/master/lib/topology_connect/shell.py#L112

There is pending work in the framework to rework the shell handling parts. This fix requires this work first.

What do you think @ocelotl ?

Regards

walintonc commented 8 years ago

Can i help you get this done?

From: Carlos Jenkins [mailto:notifications@github.com] Sent: Monday, February 15, 2016 4:58 PM To: HPENetworking/topology_docker Cc: Cambronero, Walinton Subject: Re: [topology_docker] The topology framework should stop vtysh gracefully (#15)

This should be responsibility of the OpenSwitch support node.

Maybe sending the exit command on del here:

https://github.com/HPENetworking/topology_docker/blob/master/lib/topology_docker/nodes/openswitch.py#L242

Something like:

def del(self):

self._shells['vtysh'].send_command('exit', matches=[BASH_PROMPT])

I'm assuming the send_command API for shell available in topology_connect: https://github.com/HPENetworking/topology_connect/blob/master/lib/topology_connect/shell.py#L112

There is pending work in the framework to rework the shell handling parts. This fix requires this work first.

What do you think @ocelotlhttps://github.com/ocelotl ?

Regards

— Reply to this email directly or view it on GitHubhttps://github.com/HPENetworking/topology_docker/issues/15#issuecomment-184431656.

ocelotl commented 8 years ago

I certainly do, @carlos-jenkins. I'll contact you to see how can you help us with this @walintonc, thanks a lot.

ocelotl commented 8 years ago

This issue is to be migrated when #18 is completed.

carlos-jenkins commented 8 years ago

@walintonc, @ocelotl I'm moving this issue to https://github.com/HPENetworking/topology_docker_openswitch/issues/1

Closing.