{"action":"created","issue":{"url":"https://api.github.com/repos/kimchi-project/kimchi/issues/590","labels_url":"https://api.github.com/repos/kimchi-project/kimchi/issues/590/labels{/name}","comments_url":"https://api.github.com/repos/kimchi-project/kimchi/issues/590/comments","events_url":"https://api.github.com/repos/kimchi-project/kimchi/issues/590/events","html_url":"https://github.com/kimchi-project/kimchi/issues/590","id":56828989,"number":590,"title":"Tests fail with 201!=500 on Fedora 20","user":{"login":"clnperez","id":4493281,"avatar_url":"https://avatars.githubusercontent.com/u/4493281?v=3","gravatar_id":"","url":"https://api.github.com/users/clnperez","html_url":"https://github.com/clnperez","followers_url":"https://api.github.com/users/clnperez/followers","following_url":"https://api.github.com/users/clnperez/following{/other_user}","gists_url":"https://api.github.com/users/clnperez/gists{/gist_id}","starred_url":"https://api.github.com/users/clnperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clnperez/subscriptions","organizations_url":"https://api.github.com/users/clnperez/orgs","repos_url":"https://api.github.com/users/clnperez/repos","events_url":"https://api.github.com/users/clnperez/events{/privacy}","received_events_url":"https://api.github.com/users/clnperez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-06T15:54:07Z","updated_at":"2015-02-17T21:52:38Z","closed_at":null,"body":"Ran 162 tests in 496.924s\r\nFAILED (failures=22, errors=8, skipped=3)\r\n\r\nMultiple tests fail with the reason: AssertionError: 201 != 500. For example:\r\n\r\n===========================================\r\nFAIL: test_vm_storage_devices (test_rest.RestTests)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"test_rest.py\", line 566, in test_vm_storage_devices\r\n    self.assertEquals(201, resp.status)\r\nAssertionError: 201 != 500\r\n\r\nI haven't been able to get to the bottom of these failures. Here's an interesting traceback I see for some tests:\r\n======================================================================\r\nERROR: test_vm_info (test_mockmodel.MockModelTests)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"test_mockmodel.py\", line 212, in test_vm_info\r\n    model.vms_create({'name': u'test-vm', 'template': '/templates/test'})\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/vms.py\", line 247, in create\r\n    self.caps.metadata_support)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/vms.py\", line 629, in vm_update_os_metadata\r\n    set_metadata_node(dom, os_elem, metadata_support)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/utils.py\", line 121, in set_metadata_node\r\n    flags=get_vm_config_flag(dom, mode))\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/home/christy/git/kimchi-upstream/src/kimchi/model/libvirtconnection.py\", line 66, in wrapper\r\n    ret = f(*args, **kwargs)\r\n  File \"/usr/lib64/python2.7/site-packages/libvirt.py\", line 1607, in setMetadata\r\n    if ret == -1: raise libvirtError ('virDomainSetMetadata() failed', dom=self)\r\nlibvirtError: cannot create config directory '(null)': Bad address\r\n\r\nI also see that one for ERROR: test_nonroot_access (test_authorization.AuthorizationTests), and ERROR: test_use_test_host (test_model.ModelTests). I see the same stack trace multiple times throughout the tests, so it may or may not be related to the 201!=500 failures.\r\n\r\n==========\r\n\r\n$ cat /etc/issue\r\nFedora release 20 (Heisenbug)\r\n\r\n$ uname -a\r\nLinux christy-toshiba 3.17.8-200.fc20.x86_64 #1 SMP\r\n\r\n$ rpm -q libvirt\r\nlibvirt-1.1.3.8-1.fc20.x86_64"},"comment":{"url":"https://api.github.com/repos/kimchi-project/kimchi/issues/comments/74762167","html_url":"https://github.com/kimchi-project/kimchi/issues/590#issuecomment-74762167","issue_url":"https://api.github.com/repos/kimchi-project/kimchi/issues/590","id":74762167,"user":{"login":"cd1","id":169839,"avatar_url":"https://avatars.githubusercontent.com/u/169839?v=3","gravatar_id":"","url":"https://api.github.com/users/cd1","html_url":"https://github.com/cd1","followers_url":"https://api.github.com/users/cd1/followers","following_url":"https://api.github.com/users/cd1/following{/other_user}","gists_url":"https://api.github.com/users/cd1/gists{/gist_id}","starred_url":"https://api.github.com/users/cd1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cd1/subscriptions","organizations_url":"https://api.github.com/users/cd1/orgs","repos_url":"https://api.github.com/users/cd1/repos","events_url":"https://api.github.com/users/cd1/events{/privacy}","received_events_url":"https://api.github.com/users/cd1/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T21:52:38Z","updated_at":"2015-02-17T21:52:38Z","body":"The function `test_network_lifecycle` (in test_model_network.py) has a loop which creates a few networks in order to test them later. However, each of those loop iteration tests leaks a network bridge on the system. So when the next iteration test is executed, a bridge already exists and the issue described here happens. The exception actually happens when the test network is activated, and then the following error is displayed:\r\n\r\n```\r\nlibvirt:  error : Unable to create bridge virbr1: File exists\r\n```\r\n\r\nAnd that makes the request return 500 instead of 200.\r\n\r\nI tried removing all but one of those loop iterations (i.e. I left only one network to be tested) and that test case ran fine. However, the bridge still leaked. Which is really bad (and is what's causing this issue) because we're leaving a new bridge on the system after the user runs our tests.\r\n\r\nI don't know if this is related to issue #556, but at least it seems to be."}}