Change in vdsm[master]: storagetests: add test for mount.isMounted

nsoffer at redhat.com nsoffer at redhat.com
Sun Mar 27 12:06:02 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: storagetests: add test for mount.isMounted
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/55180/1/tests/mountTests.py
File tests/mountTests.py:

Line 303: class TestRemoteSdIsMounted(TestCaseBase):
Line 304: 
Line 305:     @permutations([
Line 306:         # [<fs_spec>, <mount_line>]
Line 307:         ["server:/path",
The spec is not relevant to mount.isMounted, it accept a local file created by other code, and check if this file is mounted. So this test input is fs_file and mount_line, and it can test that isMounted is normalizing paths correctly when reading mount info from /proc/mounts. Because the local file is already normalized in storageServer, it is possible that no other normalization is needed.
Line 308:          "server:/path /rhev/data-center/mnt/server:_path nfs4 defaults 0 0"],
Line 309:     ])
Line 310:     def test_is_mounted(self, fs_spec, mount_line):
Line 311:         with fake_mounts([mount_line]):


Line 310:     def test_is_mounted(self, fs_spec, mount_line):
Line 311:         with fake_mounts([mount_line]):
Line 312:             self.assertTrue(mount.isMounted(self.generate_fs_file(fs_spec)))
Line 313: 
Line 314:     def generate_fs_file(self, fs_spec):
Not needed, as the input to this test should be a fs_file as sent by the code using this function. In the flow this is called, the code is not aware of the original spec. If the code is aware of it it should create mount.Mount() object and use its isMounted() method instead.
Line 315:         mnt_path = fs_spec.replace('_', '__').replace('/', '_')


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5f2c1c9f9fa03a079e8d94bd91f8e7b4fd43c0ee
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list