Revision e798d484
b/lib/storage/filestorage.py | ||
---|---|---|
28 | 28 |
from ganeti import errors |
29 | 29 |
|
30 | 30 |
|
31 |
def GetSpaceInfo(path): |
|
31 |
def GetFileStorageSpaceInfo(path):
|
|
32 | 32 |
"""Retrieves the free and total space of the device where the file is |
33 | 33 |
located. |
34 | 34 |
|
b/test/py/ganeti.storage.filestorage_unittest.py | ||
---|---|---|
33 | 33 |
class TestFileStorageSpaceInfo(unittest.TestCase): |
34 | 34 |
|
35 | 35 |
def testSpaceInfoPathInvalid(self): |
36 |
"""Tests that an error is raised when the given file is not existing.
|
|
36 |
"""Tests that an error is raised when the given path is not existing.
|
|
37 | 37 |
|
38 | 38 |
""" |
39 |
self.assertRaises(errors.CommandError, filestorage.GetSpaceInfo, |
|
39 |
self.assertRaises(errors.CommandError, filestorage.GetFileStorageSpaceInfo,
|
|
40 | 40 |
"/path/does/not/exist/") |
41 | 41 |
|
42 | 42 |
def testSpaceInfoPathValid(self): |
43 |
"""Tests that the 'df' command is run if the file is valid.
|
|
43 |
"""Smoke test run on a directory that exists for sure.
|
|
44 | 44 |
|
45 | 45 |
""" |
46 |
info = filestorage.GetSpaceInfo("/") |
|
46 |
info = filestorage.GetFileStorageSpaceInfo("/")
|
|
47 | 47 |
|
48 | 48 |
|
49 | 49 |
if __name__ == "__main__": |
Also available in: Unified diff