Example #1
0
 def is_process_alive(self, pid, start, end):
     
     from mysql.utilities.common.server import get_local_servers
     
     mysqld_procs = get_local_servers(False, start, end)
     for proc in mysqld_procs:
         if int(pid) == int(proc[0]):
             return True
     return False
Example #2
0
    def is_process_alive(self, pid, start, end):

        from mysql.utilities.common.server import get_local_servers

        mysqld_procs = get_local_servers(False, start, end)
        for proc in mysqld_procs:
            if int(pid) == int(proc[0]):
                return True
        return False
Example #3
0
    def is_process_alive(pid, start, end):
        """Tests if process is alive.

        pid[in]       Process ID.
        start[in]     For Windows/NT systems: Starting port value to search.
        end[in]       For Windows/NT systems: Ending port value to search.
        """
        mysqld_procs = get_local_servers(False, start, end)
        for proc in mysqld_procs:
            if int(pid) == int(proc[0]):
                return True
        return False
Example #4
0
    def is_process_alive(pid, start, end):
        """Tests if process is alive.

        pid[in]       Process ID.
        start[in]     For Windows/NT systems: Starting port value to search.
        end[in]       For Windows/NT systems: Ending port value to search.
        """
        mysqld_procs = get_local_servers(False, start, end)
        for proc in mysqld_procs:
            if int(pid) == int(proc[0]):
                return True
        return False
Example #5
0
def _show_running_servers(start=3306, end=3333):
    """Display a list of running MySQL servers.

    start[in]         starting port for Windows servers
    end[in]           ending port for Windows servers
    """
    print "# "
    processes = get_local_servers(True, start, end)
    if len(processes) > 0:
        print "# The following MySQL servers are active on this host:"
        for process in processes:
            if os.name == "posix":
                print "#  Process id: %6d, Data path: %s" % \
                    (int(process[0]), process[1])
            elif os.name == "nt":
                print "#  Process id: %6d, Port: %s" % \
                      (int(process[0]), process[1])
    else:
        print "# No active MySQL servers found."
    print "# "
Example #6
0
def _show_running_servers(start=3306, end=3333):
    """Display a list of running MySQL servers.

    start[in]         starting port for Windows servers
    end[in]           ending port for Windows servers
    """
    print "# "
    processes = get_local_servers(True, start, end)
    if len(processes) > 0:
        print "# The following MySQL servers are active on this host:"
        for process in processes:
            if os.name == "posix":
                print "#  Process id: %6d, Data path: %s" % \
                    (int(process[0]), process[1])
            elif os.name == "nt":
                print "#  Process id: %6d, Port: %s" % \
                      (int(process[0]), process[1])
    else:
        print "# No active MySQL servers found."
    print "# "
Example #7
0
        # Since all util errors (exceptions) derive from Exception, this is
        # safe.
        except Exception:
            _, err, _ = sys.exc_info()
            print("%sFAILED%s" % (BOLD_ON, BOLD_OFF))
            if conn.connect_error is not None:
                print(conn.connect_error)
            print("ERROR: %s" % str(err))
    if server_list.num_servers() == 0:
        print("ERROR: Failed to connect to any servers listed.")
        sys.exit(1)

# Check for running servers
processes = []
if server_list.num_servers():
    processes = get_local_servers(False, opt.start_port, 3333, os.getcwd())

# Kill any servers running from the test directory
if len(processes) > 0:
    print
    print("WARNING: There are existing servers running that may have been\n"
          "spawned by an earlier execution. Attempting shutdown.\n")
    _shutdown_running_servers(server_list, processes, basedir)

test_files = []
failed_tests = []
skipped_tests = []

test_files.extend(find_tests(SUITE_PATH))
test_files.extend(find_tests(opt.testdir))
Example #8
0
        # Since all util errors (exceptions) derive from Exception, this is
        # safe.
        except Exception:
            _, err, _ = sys.exc_info()
            print("%sFAILED%s" % (BOLD_ON, BOLD_OFF))
            if conn.connect_error is not None:
                print(conn.connect_error)
            print("ERROR: %s" % str(err))
    if server_list.num_servers() == 0:
        print("ERROR: Failed to connect to any servers listed.")
        sys.exit(1)

# Check for running servers
processes = []
if server_list.num_servers():
    processes = get_local_servers(False, opt.start_port, 3333, os.getcwd())

# Kill any servers running from the test directory
if len(processes) > 0:
    print
    print("WARNING: There are existing servers running that may have been\n"
          "spawned by an earlier execution. Attempting shutdown.\n")
    _shutdown_running_servers(server_list, processes, basedir)

test_files = []
failed_tests = []
skipped_tests = []

test_files.extend(find_tests(SUITE_PATH))                    
test_files.extend(find_tests(opt.testdir))