def test_minio_test_get_request(self):
     result = self.vm_server.minio_test_get_request()
     print(result)
     vm = self.vm_server.sdk.find_by_name(
         self.vm_server.vm_name__minio_test)
     vm_process = VM_Process(vm)
     pprint(vm_process.curl('http://91.109.26.22'))
Esempio n. 2
0
    def minio_test_setup_network(self):
        vm = self.sdk.find_by_name("test-vm-from-ovf")
        vm_process = VM_Process(vm)
        #print(vm_process.exec('/bin/ip', 'a'))
        #print(vm_process.exec('/bin/ip', 'addr add 10.102.66.200/24 dev enp0s25'))
        #print(vm_process.exec('/bin/cat', '/etc/shadow'))
        #print(vm_process.exec('/bin/bash', '-c "sudo /bin/cat /etc/shadow"'))
        print(vm_process.exec('/bin/bash', '-c "sudo ip addr add 78.159.113.32/26 dev eth0"')) # commands from https://ubuntu.com/server/docs/network-configuration
        print(vm_process.exec('/bin/bash', '-c "sudo ip route add default via 78.159.113.62"'))

        print(vm_process.exec('/bin/ip', 'a'))
        print(vm_process.exec('/bin/ip', 'route show'))
Esempio n. 3
0
    def setUp(self) -> None:
        self.sdk = Sdk()
        self.vm_name = 'dinis-test-via-ovf'
        self.vm = self.sdk.find_by_name(self.vm_name)
        if self.vm is None:
            pytest.skip(f"target server did not have vm {self.vm_name}")
        else:
            if self.vm.powered_off():
                pytest.skip(
                    f"target server exists but it not Powered On {self.vm_name}"
                )

        self.vm_process = VM_Process(vm=self.vm)
Esempio n. 4
0
    def minio_test_setup_network(self):
        vm = self.sdk.find_by_name(self.vm_name__minio_test)
        vm_process = VM_Process(vm)
        #print(vm_process.exec('/bin/ip', 'a'))
        #print(vm_process.exec('/bin/ip', 'addr add 10.102.66.200/24 dev enp0s25'))
        #print(vm_process.exec('/bin/cat', '/etc/shadow'))
        #print(vm_process.exec('/bin/bash', '-c "sudo /bin/cat /etc/shadow"'))
        print(
            vm_process.exec('/bin/bash',
                            '-c "sudo ip addr add 91.109.26.22/27 dev eth0"')
        )  # commands from https://ubuntu.com/server/docs/network-configuration
        print(
            vm_process.exec('/bin/bash',
                            '-c "sudo ip route add default via 91.109.26.30"'))

        print(vm_process.exec('/bin/ip', 'a'))
        print(vm_process.exec('/bin/ip', 'route show'))
Esempio n. 5
0
 def ubuntu_vm_run_commands(self):
     vm_name = "test_ubuntu"
     vm = self.sdk.find_by_name(vm_name)
     vm_process = VM_Process(vm)
     vm_process.set_vm_account_from_env("VM_UBUNTU")
     print(vm_process.vm_account)