Change in vdsm[master]: tests: fix testGetHostNameservers

fromani at redhat.com fromani at redhat.com
Mon Sep 21 07:35:40 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: tests: fix testGetHostNameservers
......................................................................

tests: fix testGetHostNameservers

The testGetHostNameservers fails on my Fedora 22 box like

======================================================================
ERROR: testGetHostNameservers (netinfoTests.TestNetinfo)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/fromani/Projects/upstream/vdsm/tests/netinfoTests.py",
line 61, in testGetHostNameservers
    with open(file_path, 'w') as file_object:
IOError: [Errno 13] Permission denied: '/etc/resolv.conf'

The issue in the tests is it wants to create a named temprary directory
with one subdirectory (etc) on it, but there is no need for that,
a simple file is enough.

This patch unbreak the test.

Change-Id: I556c7fd9a43bb2a21bf51fc6b42f23513aa7f526
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M tests/netinfoTests.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/46441/1

diff --git a/tests/netinfoTests.py b/tests/netinfoTests.py
index b894d46..9c13594 100644
--- a/tests/netinfoTests.py
+++ b/tests/netinfoTests.py
@@ -55,7 +55,7 @@
         )
         dnss = ['192.168.0.100', '8.8.8.8', '8.8.4.4']
         with namedTemporaryDir() as temp_dir:
-            file_path = os.path.join(temp_dir, '/etc/resolv.conf')
+            file_path = os.path.join(temp_dir, 'resolv.conf')
 
             with MonkeyPatchScope([(netinfo, 'DNS_CONF_FILE', file_path)]):
                 with open(file_path, 'w') as file_object:


-- 
To view, visit https://gerrit.ovirt.org/46441
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I556c7fd9a43bb2a21bf51fc6b42f23513aa7f526
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list