Пример #1
0
                                          'gateway': '8.12.42.3'},
                                         {'network': '4.0.0.0/8',
                                         'gateway': '10.210.1.4'}]}]},
                {'mac_address': '90:b8:d0:0a:51:31', 'mtu': 1500,
                 'name': 'net1', 'type': 'physical',
                 'subnets': [{'address': '10.210.1.27/24', 'type': 'static',
                              'routes': [{'network': '3.0.0.0/8',
                                          'gateway': '8.12.42.3'},
                                         {'network': '4.0.0.0/8',
                                         'gateway': '10.210.1.4'}]}]}]}
        found = convert_net(SDC_NICS_SINGLE_GATEWAY, routes=routes)
        self.maxDiff = None
        self.assertEqual(expected, found)


@unittest2.skipUnless(get_smartos_environ() == SMARTOS_ENV_KVM,
                      "Only supported on KVM and bhyve guests under SmartOS")
@unittest2.skipUnless(os.access(SERIAL_DEVICE, os.W_OK),
                      "Requires write access to " + SERIAL_DEVICE)
@unittest2.skipUnless(HAS_PYSERIAL is True, "pyserial not available")
class TestSerialConcurrency(CiTestCase):
    """
       This class tests locking on an actual serial port, and as such can only
       be run in a kvm or bhyve guest running on a SmartOS host.  A test run on
       a metadata socket will not be valid because a metadata socket ensures
       there is only one session over a connection.  In contrast, in the
       absence of proper locking multiple processes opening the same serial
       port can corrupt each others' exchanges with the metadata server.

       This takes on the order of 2 to 3 minutes to run.
    """
Пример #2
0
                    'routes': [{
                        'network': '3.0.0.0/8',
                        'gateway': '8.12.42.3'
                    }, {
                        'network': '4.0.0.0/8',
                        'gateway': '10.210.1.4'
                    }]
                }]
            }]
        }
        found = convert_net(SDC_NICS_SINGLE_GATEWAY, routes=routes)
        self.maxDiff = None
        self.assertEqual(expected, found)


@unittest2.skipUnless(get_smartos_environ() == SMARTOS_ENV_KVM,
                      "Only supported on KVM and bhyve guests under SmartOS")
@unittest2.skipUnless(os.access(SERIAL_DEVICE, os.W_OK),
                      "Requires write access to " + SERIAL_DEVICE)
@unittest2.skipUnless(HAS_PYSERIAL is True, "pyserial not available")
class TestSerialConcurrency(CiTestCase):
    """
       This class tests locking on an actual serial port, and as such can only
       be run in a kvm or bhyve guest running on a SmartOS host.  A test run on
       a metadata socket will not be valid because a metadata socket ensures
       there is only one session over a connection.  In contrast, in the
       absence of proper locking multiple processes opening the same serial
       port can corrupt each others' exchanges with the metadata server.

       This takes on the order of 2 to 3 minutes to run.
    """
Пример #3
0
                            {
                                "network": "4.0.0.0/8",
                                "gateway": "10.210.1.4",
                            },
                        ],
                    }],
                },
            ],
        }
        found = convert_net(SDC_NICS_SINGLE_GATEWAY, routes=routes)
        self.maxDiff = None
        self.assertEqual(expected, found)


@unittest.skipUnless(
    get_smartos_environ() == SMARTOS_ENV_KVM,
    "Only supported on KVM and bhyve guests under SmartOS",
)
@unittest.skipUnless(
    os.access(SERIAL_DEVICE, os.W_OK),
    "Requires write access to " + SERIAL_DEVICE,
)
class TestSerialConcurrency(CiTestCase):
    """
    This class tests locking on an actual serial port, and as such can only
    be run in a kvm or bhyve guest running on a SmartOS host.  A test run on
    a metadata socket will not be valid because a metadata socket ensures
    there is only one session over a connection.  In contrast, in the
    absence of proper locking multiple processes opening the same serial
    port can corrupt each others' exchanges with the metadata server.