def test_Node_syslog(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) assert node.syslog()
def test_Node_subscription(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) assert node.subscription()
def test_Node_rrddata(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) assert node.rrddata(timeframe='hour')
def test_Node_vzdump(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) assert node.vzdump(vmid=108, stdout=True, compress='gzip')
def test_Node_rrd(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) assert node.rrd(ds='cpu',timeframe='hour')
def test_OpenVZ_stop(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) vm = node.openvz(VMID) # 108 is a testing vm 'packages' assert vm.stop()
def test_create_OpenVZ_Object_FromNode(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) vm = node.openvz(VMID) # VMID is a testing vm 'packages' assert isinstance(vm, OpenVZ) assert vm.vmid == VMID assert vm.baseurl == 'https://{0}:8006/api2/json/nodes/{0}/openvz/{1}'.format(PROXMOX_HOST,VMID)
def test_Node_raiseExceptionOnUndefined(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) try: node.failme() except ProxmoxError as e: logging.debug(e) assert True return assert False
def test_create_Node_object(): PROXMOX_HOST = "proxmox-7" PROXMOX_PORT = 8006 USER = "******" PASSWD = "strawberries" VMID = 108 connection = Connector(PROXMOX_HOST, PROXMOX_PORT) connection.fetch_auth_token(USER, PASSWD) node = Node(connection, PROXMOX_HOST) assert isinstance(node, Node) assert node.node == PROXMOX_HOST assert node.baseurl == 'https://{0}:8006/api2/json/nodes/{0}'.format( PROXMOX_HOST)