def remote_system_wget(self, file: str, remote_path: str):
     """
     The RemoteSystem downloads the file from the PI and stores it at remote_file
     :param file: like /root/TestFramework/firmware/.../<firmware>.bin
     :param remote_path: like /tmp/
     """
     try:
         webserver = WebServer()
         webserver.start()
         # Proves first if file already exists
         self.send_command(
             "test -f /"
             + remote_path
             + "/"
             + file.split("/")[-1]
             + " || wget http://"
             + self.nv_assisten.namespace.get_ip_of_encapsulate_interface()
             + ":"
             + str(WebServer.PORT_WEBSERVER)
             + file.replace(WebServer.BASE_DIR, "")
             + " -P "
             + remote_path
         )
         webserver.join()
     except Exception as e:
         Logger().error(str(e), 2)
Ejemplo n.º 2
0
 def remote_system_wget(self, file: str, remote_path: str, web_server_ip: str):
     """
     The RemoteSystem downloads the file from the PI and stores it at remote_file
     :param file: like /root/TestFramework/firmware/.../<firmware>.bin
     :param remote_path: like /tmp/
     :param web_server_ip: IP-address of the raspberryPI
     """
     webserver = WebServer()
     try:
         webserver.start()
         # Proves first if file already exists
         self.send_command('test -f /' + remote_path + '/' + file.split('/')[-1] +
                           ' || wget http://' + web_server_ip + ':' + str(WebServer.PORT_WEBSERVER) +
                           file.replace(WebServer.BASE_DIR, '') + ' -P ' + remote_path)
     except Exception as e:
         logging.error("%s" + str(e), LoggerSetup.get_log_deep(2))
     finally:
         webserver.join()
Ejemplo n.º 3
0
    def remote_system_wget(self, file: str, remote_path: str,
                           web_server_ip: str):
        """
        The RemoteSystem downloads the file from the PI and stores it at remote_file.
        Therefore this function starts a webserver in a new thread.

        :param file: Like '/root/TestFramework/firmware/.../<firmware>.bin'
        :param remote_path: Like '/tmp/'
        :param web_server_ip: IP-address of the PI
        """
        webserver = WebServer()
        try:
            logging.debug(
                "%sForce the Router to download Data from the own WebServer ...",
                LoggerSetup.get_log_deep(2))
            webserver.start()
            # Proves first if file already exists
            self.send_command('test -f /' + remote_path + '/' +
                              file.split('/')[-1] + ' || wget http://' +
                              web_server_ip + ':' +
                              str(WebServer.PORT_WEBSERVER) +
                              file.replace(WebServer.BASE_DIR, '') + ' -P ' +
                              remote_path)
        except Exception as e:
            logging.error("%s" + str(e), LoggerSetup.get_log_deep(2))
        finally:
            webserver.join()
Ejemplo n.º 4
0
 def remote_system_wget(self, file: str, remote_path: str):
     """
     The RemoteSystem downloads the file from the PI and stores it at remote_file
     :param file: like /root/TestFramework/firmware/.../<firmware>.bin
     :param remote_path: like /tmp/
     """
     try:
         webserver = WebServer()
         webserver.start()
         # Proves first if file already exists
         self.send_command('test -f /' + remote_path + '/' + file.split('/')[-1] +
                           ' || wget http://' + self.nv_assisten.namespace.get_ip_of_encapsulate_interface() + ':' +
                           str(WebServer.PORT_WEBSERVER) +
                           file.replace(WebServer.BASE_DIR, '') + ' -P ' + remote_path)
         webserver.join()
     except Exception as e:
         Logger().error(str(e), 2)
Ejemplo n.º 5
0
from network.webserver import WebServer


webserver = WebServer()
webserver.start()
webserver.join()