def test_name_validation(self):
        server = dict(name='server1 ',
                      imageRef=self.image_id,
                      flavorRef=self.flavor_id)
        try:
            self.api.post_server({'server': server})
        except client.OpenStackApiException as osae:
            # We expect this to be a 400 error with validation problems.
            self.assertEqual(400, osae.response.status_code)
            # NOTE(sdague): using expectFailure means we can land this
            # test while the bug still exists, then fix it after.
            self.expectFailure(
                "This is expected to fail until bug 1541691 is fixed",
                self.assertLess,
                len(osae.response.content),
                1000,
                "The length of the error response is > 1k. Something is "
                "wrong.")
            return
        self.fail("We should have thrown a 400 error")
Creates the actual network.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/functional/regressions/test_bug_1541691.py/TestServerValidation.test_name_validation--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/providers/azure/azure_network.py/AzureNetwork.Create