def test_create_w_config(tcp_config): monitor = target.TCPMonitor(**tcp_config) assert monitor assert monitor.name == "test_monitor" assert monitor.partition == "Test" data = monitor.data assert data.get('interval') == 1 assert data.get('timeout') == 10 assert data.get('send') == "GET /\r\n" assert data.get('recv') == "SERVER"
def test_crud_tcp_monitor(self): """Tests the tcp monitor arch-type""" assert getattr(self, 'bigip', None), \ 'We should always have a bigip at this point...' partition = "Common" name = "test_tcp" schema = tcp.TCPMonitor.properties schema['partition'] = partition schema['name'] = name monitor = tcp.TCPMonitor(**schema) self.crud_test(monitor)
def test_create_w_defaults(tcp_config): monitor = target.TCPMonitor(name=tcp_config['name'], partition=tcp_config['partition']) assert monitor assert monitor.name == "test_monitor" assert monitor.partition == "Test" data = monitor.data assert data.get('interval') == 5 assert data.get('timeout') == 16 assert data.get('send') == "" assert data.get('recv') == ""
def test_get_uri_path(bigip, tcp_config): monitor = target.TCPMonitor(**tcp_config) assert (monitor._uri_path(bigip) == bigip.tm.ltm.monitor.tcps.tcp)