def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_one = self._machines[0]['vms'][0]['name']

        # create a 10G temporary file
        working_dir = self._test_param(None)['working_dir']

        # all test run on a separate drive
        os.chdir(working_dir)
        if os.path.isfile(TEMP_FILE_NAME):
            os.remove(TEMP_FILE_NAME)

        if os.path.isfile(TEMP_FILE_NAME_TARGET):
            os.remove(TEMP_FILE_NAME_TARGET)

        args['filename'] = TEMP_FILE_NAME
        test_class._run_on_vm(self, vm_one, "generate_ten_gig_file", args)

        # then make a copy
        args['dest_filename'] = TEMP_FILE_NAME_TARGET
        test_class._run_on_vm(self, vm_one, "copy_file", args)
Exemplo n.º 2
0
    def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]["host"]

        # get a VM
        vm_one = self._machines[0]["vms"][0]["name"]

        # create a 10G temporary file
        working_dir = self._test_param(None)["working_dir"]

        # all test run on a separate drive
        os.chdir(working_dir)
        if os.path.isfile(TEMP_FILE_NAME):
            os.remove(TEMP_FILE_NAME)

        if os.path.isfile(TEMP_FILE_NAME_TARGET):
            os.remove(TEMP_FILE_NAME_TARGET)

        args["filename"] = TEMP_FILE_NAME
        test_class._run_on_vm(self, vm_one, "generate_ten_gig_file", args)

        # then make a copy
        args["dest_filename"] = TEMP_FILE_NAME_TARGET
        test_class._run_on_vm(self, vm_one, "copy_file", args)
    def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_one = self._machines[0]['vms'][0]['name']

        args['working_dir'] = self._test_param(None)['working_dir']
        test_class._run_on_vm(self, vm_one, "run_iozone", args)
    def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_one = self._machines[0]['vms'][0]['name']

        args['working_dir'] = self._test_param(None)['working_dir']
        test_class._run_on_vm(self, vm_one, "run_iozone", args)
Exemplo n.º 5
0
    def _run(self, args):
        # EXAMPLE: do something...
        print 'Inside _run'

        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_one = self._machines[0]['vms'][0]['name']

        test_class._run_on_vm(self, vm_one, "start_example", args)
Exemplo n.º 6
0
    def _run(self, args):
        # EXAMPLE: do something...
        print 'Inside _run'

        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_one = self._machines[0]['vms'][0]['name']

        test_class._run_on_vm(self, vm_one, "start_example", args)
Exemplo n.º 7
0
    def _run(self, args):
        # get the workers

        args = dict(args.items() + self._test_param(None).items())

        for host in self._machines:
            for vm in host['vms']:
                print 'Running test on VM: "%s"' % vm['name']
                for i in range(3):
                    print 'Iterate #%d' % i
                    args['perf_drive'] = vm['perf_drive']
                    args['count'] = i
                    test_class._run_on_vm(self, vm['name'], 'run_fio', args)

                    # cool down a bit
                    time.sleep(DEFAULT_COOL_DOWN_TIME)
Exemplo n.º 8
0
    def _run(self, args):
        # get the workers

        args = dict(args.items() + self._test_param(None).items())

        for host in self._machines:
            for vm in host['vms']:
                print 'Running test on VM: "%s"' % vm['name']
                for i in range(3):
                    print 'Iterate #%d' % i
                    args['perf_drive'] = vm['perf_drive']
                    args['count'] = i
                    test_class._run_on_vm(self, vm['name'], 'run_fio', args)

                    # cool down a bit
                    time.sleep(DEFAULT_COOL_DOWN_TIME)
Exemplo n.º 9
0
    def run_write_kvp(self, args):
        import hypervlib.hyperv

        for host in self._machines:
            host_name = host['host']

            args['host_name'] = host_name
            for vm in host['vms']:
                vm_name = vm['name']
                args['vm_name'] = vm_name

                written_kvps = self.write_from_host(args)
                if written_kvps is None:
                    print 'ERROR: failed to write KVP to host'
                    return 

                args['kvp'] = written_kvps

                match = test_class._run_on_vm(self, vm_name, "match_in_client", args)

                # remove the random data, we don't want KVP pool file to be flooded.
                if not match:
                    print 'ERROR: failed to add KVP item'

                print 'Removing test KVP items'
                for kvp_key in written_kvps.keys():
                    hypervlib.hyperv.remove_kvp_item(kvp_key, vm_name, host_name)
    def run_write_kvp(self, args):
        import hypervlib.hyperv

        for host in self._machines:
            host_name = host['host']

            args['host_name'] = host_name
            for vm in host['vms']:
                vm_name = vm['name']
                args['vm_name'] = vm_name

                written_kvps = self.write_from_host(args)
                if written_kvps is None:
                    print 'ERROR: failed to write KVP to host'
                    return

                args['kvp'] = written_kvps

                match = test_class._run_on_vm(self, vm_name, "match_in_client",
                                              args)

                # remove the random data, we don't want KVP pool file to be flooded.
                if not match:
                    print 'ERROR: failed to add KVP item'

                print 'Removing test KVP items'
                for kvp_key in written_kvps.keys():
                    hypervlib.hyperv.remove_kvp_item(kvp_key, vm_name,
                                                     host_name)
    def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_server = self._machines[0]['vms'][0]['name']
        vm_client = self._machines[0]['vms'][1]['name']

        args['server_ip'] = self._machines[0]['vms'][0]['addr']

        print vm_server, vm_client, args['server_ip']

        # no need to do multi-threading since iperf server can be launched
        # as a daemon, and will return immediately.
        test_class._run_on_vm(self, vm_server, "run_iperf_server", args)
        test_class._run_on_vm(self, vm_client, "run_iperf_client", args)
Exemplo n.º 12
0
    def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_server = self._machines[0]['vms'][0]['name']
        vm_client = self._machines[0]['vms'][1]['name']

        args['server_ip'] = self._machines[0]['vms'][0]['addr']

        print vm_server, vm_client, args['server_ip']

        # no need to do multi-threading since iperf server can be launched
        # as a daemon, and will return immediately.
        test_class._run_on_vm(self, vm_server, "run_iperf_server", args)
        test_class._run_on_vm(self, vm_client, "run_iperf_client", args)
    def _run(self, args):

        for host in self._machines:
            host_name = host['host']

            # get host time
            # since we don't implement _run_on_host just yet, we'll have to do
            # this using WMI
            args['host_name'] = host_name
            host_time = self.get_host_time(args)

            for vm in host['vms']:
                vm_name = vm['name']

                # get VM time
                vm_time = test_class._run_on_vm(self, vm_name, "get_bsd_time", args)

                delta = abs(vm_time - host_time)
                print 'Time diff between host "%s" and VM "%s" is' % (host_name, vm_name), \
                      delta, 'seconds'
    def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_server = self._machines[0]['vms'][0]['name']
        vm_client = self._machines[1]['vms'][0]['name']

        args['server_ip'] = self._machines[0]['vms'][0]['addr']
        args['filename'] = TEMP_FILE_NAME
        args['working_dir'] = self._test_param(None)['working_dir']

        test_class._run_on_vm(self, vm_server, "generate_ten_gig_file", args)

        args['username'] = self._test_param(None)['username']
        args['password'] = self._test_param(None)['password']
        args['remote_path'] = self._test_param(None)['remote_path']
        test_class._run_on_vm(self, vm_client, "copy_file_over_network", args)
        print "File has been copied from server to client successfully."
        
        test_class._run_on_vm(self, vm_client, "remove_file", args)
        test_class._run_on_vm(self, vm_server, "remove_file", args)
        print "File has been removed on both server and client."
    def _run(self, args):
        # get a host...
        # yes I know it's ugly
        host_one = self._machines[0]['host']

        # get a VM
        vm_server = self._machines[0]['vms'][0]['name']
        vm_client = self._machines[1]['vms'][0]['name']

        args['server_ip'] = self._machines[0]['vms'][0]['addr']
        args['filename'] = TEMP_FILE_NAME
        args['working_dir'] = self._test_param(None)['working_dir']

        test_class._run_on_vm(self, vm_server, "generate_ten_gig_file", args)

        args['username'] = self._test_param(None)['username']
        args['password'] = self._test_param(None)['password']
        args['remote_path'] = self._test_param(None)['remote_path']
        test_class._run_on_vm(self, vm_client, "copy_file_over_network", args)
        print "File has been copied from server to client successfully."

        test_class._run_on_vm(self, vm_client, "remove_file", args)
        test_class._run_on_vm(self, vm_server, "remove_file", args)
        print "File has been removed on both server and client."
 def _set_up_vm(self, vm_name, args):
     # this piece of code will be executed first thing after the VM is
     # booted up
     test_class._run_on_vm(self, vm_name, "install_iperf", args)
Exemplo n.º 17
0
 def _set_up_vm(self, vm_name, args):
     # this piece of code will be executed first thing after the VM is 
     # booted up
     args['working_dir'] = self._test_param(None)['working_dir']
     test_class._run_on_vm(self, vm_name, "install_iozone", args)
     test_class._run_on_vm(self, vm_name, "format_drive", args)
 def _set_up_vm(self, vm_name, args):
     # this piece of code will be executed first thing after the VM is
     # booted up
     args['working_dir'] = self._test_param(None)['working_dir']
     test_class._run_on_vm(self, vm_name, "format_drive", args)
Exemplo n.º 19
0
    def _set_up_vm(self, vm_name, args):
        # this piece of code will be executed first thing after the VM is 
        # booted up

        test_class._run_on_vm(self, vm_name, "install_fio", args)