

from gkeeprobot.control.ServerControl import ServerControl

"""Provides keywords for robotframework to configure gkserver before
testing begins."""

control = ServerControl()


class ServerSetupKeywords:

    def add_file_to_server(self, username, filename, target_filename):
        control.copy(username, filename, target_filename)

    def start_gkeepd(self):
        control.run('keeper', 'screen -S gkserver -d -m gkeepd')

    def add_account_on_server(self, faculty_name):
        cmd = 'sudo useradd -ms /bin/bash {}'.format(faculty_name)
        control.run('keeper', cmd)

    def reset_server(self):
        control.run_vm_python_script('keeper', 'reset_server.py')



from gkeeprobot.control.ServerControl import ServerControl

"""Provides keywords for robotframework to configure gkserver before
testing begins."""

control = ServerControl()


class ServerSetupKeywords:

    def add_file_to_server(self, username, filename, target_filename):
        control.copy(username, filename, target_filename)

    def start_gkeepd(self):
        control.run('keeper', 'screen -S gkserver -d -m gkeepd')

    def stop_gkeepd(self):
        control.run('keeper', 'screen -S gkserver -X quit')

    def add_account_on_server(self, faculty_name):
        cmd = 'sudo useradd -ms /bin/bash {}'.format(faculty_name)
        control.run('keeper', cmd)

    def reset_server(self):
        control.run_vm_python_script('keeper', 'reset_server.py')

Add command to stop gkeepd
Add command to stop gkeepd

  
  
  from gkeeprobot.control.ServerControl import ServerControl
  
  """Provides keywords for robotframework to configure gkserver before
  testing begins."""
  
  control = ServerControl()
  
  
  class ServerSetupKeywords:
  
      def add_file_to_server(self, username, filename, target_filename):
          control.copy(username, filename, target_filename)
  
      def start_gkeepd(self):
          control.run('keeper', 'screen -S gkserver -d -m gkeepd')
  
+     def stop_gkeepd(self):
+         control.run('keeper', 'screen -S gkserver -X quit')
+ 
      def add_account_on_server(self, faculty_name):
          cmd = 'sudo useradd -ms /bin/bash {}'.format(faculty_name)
          control.run('keeper', cmd)
  
      def reset_server(self):
          control.run_vm_python_script('keeper', 'reset_server.py')
  
Add command to stop gkeepd
## Code Before:


from gkeeprobot.control.ServerControl import ServerControl

"""Provides keywords for robotframework to configure gkserver before
testing begins."""

control = ServerControl()


class ServerSetupKeywords:

    def add_file_to_server(self, username, filename, target_filename):
        control.copy(username, filename, target_filename)

    def start_gkeepd(self):
        control.run('keeper', 'screen -S gkserver -d -m gkeepd')

    def add_account_on_server(self, faculty_name):
        cmd = 'sudo useradd -ms /bin/bash {}'.format(faculty_name)
        control.run('keeper', cmd)

    def reset_server(self):
        control.run_vm_python_script('keeper', 'reset_server.py')

## Instruction:
Add command to stop gkeepd
## Code After:


from gkeeprobot.control.ServerControl import ServerControl

"""Provides keywords for robotframework to configure gkserver before
testing begins."""

control = ServerControl()


class ServerSetupKeywords:

    def add_file_to_server(self, username, filename, target_filename):
        control.copy(username, filename, target_filename)

    def start_gkeepd(self):
        control.run('keeper', 'screen -S gkserver -d -m gkeepd')

    def stop_gkeepd(self):
        control.run('keeper', 'screen -S gkserver -X quit')

    def add_account_on_server(self, faculty_name):
        cmd = 'sudo useradd -ms /bin/bash {}'.format(faculty_name)
        control.run('keeper', cmd)

    def reset_server(self):
        control.run_vm_python_script('keeper', 'reset_server.py')
