Dan Kenigsberg has uploaded a new change for review.
Change subject: miscTests: Use /var/tmp for O_DIRECT tests
......................................................................
miscTests: Use /var/tmp for O_DIRECT tests
Fedora 18 uses tmpfs for /tmp, which causes our tests with
dd if=/tmp/bla iflag=direct
to fail. This patch uses /var/tmp which usually supports O_DIRECT.
This is a less intrussive way to fix the tests without touching
vdsm-proper, as suggested in
http://gerrit.ovirt.org/9661 .
Change-Id: Ia9c58ee86138777ea6059be3aee25c92dd8ec9c7
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M tests/miscTests.py
1 file changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/9727/1
diff --git a/tests/miscTests.py b/tests/miscTests.py
index 4c986ed..61e3af3 100644
--- a/tests/miscTests.py
+++ b/tests/miscTests.py
@@ -49,6 +49,7 @@
SUDO_USER = "root"
SUDO_GROUP = "root"
+TMPDIR = '/var/tmp'
def ddWatchCopy(srcPath, dstPath, callback, dataLen):
rc, out, err = misc.ddWatchCopy(srcPath, dstPath, callback, dataLen)
@@ -439,7 +440,7 @@
if (len(data) % 512) == 0:
data += "!"
- srcFd, srcPath = tempfile.mkstemp()
+ srcFd, srcPath = tempfile.mkstemp(dir=TMPDIR)
f = os.fdopen(srcFd, "wb")
f.write(data)
f.flush()
@@ -447,7 +448,7 @@
os.chmod(srcPath, 0666)
#Get a tempfilename
- dstFd, dstPath = tempfile.mkstemp()
+ dstFd, dstPath = tempfile.mkstemp(dir=TMPDIR)
os.chmod(dstPath, 0666)
#Copy
@@ -478,7 +479,7 @@
# Makes sure we round up to a complete block size
data *= 512
- srcFd, srcPath = tempfile.mkstemp()
+ srcFd, srcPath = tempfile.mkstemp(dir=TMPDIR)
f = os.fdopen(srcFd, "wb")
f.write(data)
f.flush()
@@ -486,7 +487,7 @@
os.chmod(srcPath, 0666)
#Get a tempfilename
- dstFd, dstPath = tempfile.mkstemp()
+ dstFd, dstPath = tempfile.mkstemp(dir=TMPDIR)
os.chmod(dstPath, 0666)
#Copy
@@ -508,7 +509,7 @@
exception.
"""
#Get a tempfilename
- srcFd, srcPath = tempfile.mkstemp()
+ srcFd, srcPath = tempfile.mkstemp(dir=TMPDIR)
os.unlink(srcPath)
#Copy
@@ -520,7 +521,7 @@
Test that stop really stops the copying process.
"""
try:
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(dir=TMPDIR) as f:
ddWatchCopy("/dev/zero", f.name, lambda: True, 100)
except misc.se.ActionStopped:
self.log.info("Looks like stopped!")
--
To view, visit
http://gerrit.ovirt.org/9727
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9c58ee86138777ea6059be3aee25c92dd8ec9c7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>