Hello Yaniv Bronhaim,
I'd like you to do a code review. Please visit
to review the following change.
Change subject: fix storage.fuser ......................................................................
fix storage.fuser
Bug-Url: https://bugzilla.redhat.com/922515 Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 Signed-off-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/13302 Reviewed-by: Yaniv Bronhaim ybronhei@redhat.com Tested-by: Yaniv Bronhaim ybronhei@redhat.com --- M tests/Makefile.am A tests/fuserTests.py M vdsm/storage/fuser.py 3 files changed, 33 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/13303/1
diff --git a/tests/Makefile.am b/tests/Makefile.am index 8ad34e2..9aec750 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,6 +27,7 @@ capsTests.py \ configNetworkTests.py \ fileUtilTests.py \ + fuserTests.py \ getAllVolumesTests.py \ glusterTestData.py \ gluster_cli_tests.py \ diff --git a/tests/fuserTests.py b/tests/fuserTests.py new file mode 100644 index 0000000..7473dde --- /dev/null +++ b/tests/fuserTests.py @@ -0,0 +1,31 @@ +# +# Copyright 2013 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +import os +from storage import fuser + +from testrunner import VdsmTestCase + + +class TestFuser(VdsmTestCase): + + def testSelfExe(self): + pid = os.getpid() + self.assertTrue(pid in fuser.fuser('/proc/%s/exe' % pid)) diff --git a/vdsm/storage/fuser.py b/vdsm/storage/fuser.py index d9becbc..135dad6 100644 --- a/vdsm/storage/fuser.py +++ b/vdsm/storage/fuser.py @@ -27,7 +27,7 @@ cmd.append("-m")
cmd.append(path) - (rc, out, err) = misc.execCmd(cmd, sudo=True) + (rc, out, err) = misc.execCmd(cmd, raw=True, sudo=True) if rc != 0: return []
-- To view, visit http://gerrit.ovirt.org/13303 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.2 Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com
Yaniv Bronhaim has posted comments on this change.
Change subject: fix storage.fuser ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/13303 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.2 Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: fix storage.fuser ......................................................................
Patch Set 1: Verified
-- To view, visit http://gerrit.ovirt.org/13303 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.2 Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com
Federico Simoncelli has posted comments on this change.
Change subject: fix storage.fuser ......................................................................
Patch Set 1: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/13303 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.2 Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com
Federico Simoncelli has submitted this change and it was merged.
Change subject: fix storage.fuser ......................................................................
fix storage.fuser
Bug-Url: https://bugzilla.redhat.com/922515 Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 Signed-off-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/13302 Reviewed-by: Yaniv Bronhaim ybronhei@redhat.com Tested-by: Yaniv Bronhaim ybronhei@redhat.com --- M tests/Makefile.am A tests/fuserTests.py M vdsm/storage/fuser.py 3 files changed, 33 insertions(+), 1 deletion(-)
Approvals: Yaniv Bronhaim: Looks good to me, but someone else must approve Federico Simoncelli: Looks good to me, approved Dan Kenigsberg: Verified
-- To view, visit http://gerrit.ovirt.org/13303 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Iabd58847db7090f83106d30a763d09c0a7b78741 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.2 Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com
vdsm-patches@lists.fedorahosted.org