Revert "Update platform_CrosDisksFilesystem ext2/3/4 tests."
This reverts commit dc6e31a09ca866b75bd06caa6323828b6f6ec5f0.
CL:223391 re-enables the support of ext2/3/4 filesystem in cros-disks.
This CL updates platform_CrosDisksFilesystem ext2/3/4 tests to verify
that mounting of ext2/3/4 filesystems via cros-disks succeeds again.
BUG=chromium:315401
TEST=Run platform_CrosDisksFilesystem tests.
(cherry picked from commit 4fdcff4414f3625bbc1ee7bd3a88446fc45196f0)
Change-Id: Id812a197d2efea3799d50a93c5065696de23699f
Reviewed-on: https://chromium-review.googlesource.com/223421
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/client/site_tests/platform_CrosDisksFilesystem/ext2_tests b/client/site_tests/platform_CrosDisksFilesystem/ext2_tests
index 6504180..55fd5fb 100644
--- a/client/site_tests/platform_CrosDisksFilesystem/ext2_tests
+++ b/client/site_tests/platform_CrosDisksFilesystem/ext2_tests
@@ -6,7 +6,8 @@
"filesystem_type": "ext2",
"mkfs_options": [ "-L", "MyDisk" ],
"test_mount_options": [ "ro", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/MyDisk"
},
{
"description": "ext2 filesystem with UUID (read)",
@@ -15,7 +16,8 @@
"filesystem_type": "ext2",
"mkfs_options": [ "-U", "01234567-89ab-cdef-0123-456789abcdef" ],
"test_mount_options": [ "ro", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/External Drive"
},
{
"description": "ext2 filesystem (write)",
@@ -25,6 +27,7 @@
"filesystem_type": "ext2",
"mkfs_options": [ "-L", "MyDisk" ],
"test_mount_options": [ "rw", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/MyDisk"
}
]
diff --git a/client/site_tests/platform_CrosDisksFilesystem/ext3_tests b/client/site_tests/platform_CrosDisksFilesystem/ext3_tests
index 0bda37a..9d091ec 100644
--- a/client/site_tests/platform_CrosDisksFilesystem/ext3_tests
+++ b/client/site_tests/platform_CrosDisksFilesystem/ext3_tests
@@ -6,7 +6,8 @@
"filesystem_type": "ext3",
"mkfs_options": [ "-L", "MyDisk" ],
"test_mount_options": [ "ro", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/MyDisk"
},
{
"description": "ext3 filesystem with UUID (read)",
@@ -15,7 +16,8 @@
"filesystem_type": "ext3",
"mkfs_options": [ "-U", "01234567-89ab-cdef-0123-456789abcdef" ],
"test_mount_options": [ "ro", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/External Drive"
},
{
"description": "ext3 filesystem (write)",
@@ -25,6 +27,7 @@
"filesystem_type": "ext3",
"mkfs_options": [ "-L", "MyDisk" ],
"test_mount_options": [ "rw", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/MyDisk"
}
]
diff --git a/client/site_tests/platform_CrosDisksFilesystem/ext4_tests b/client/site_tests/platform_CrosDisksFilesystem/ext4_tests
index fc3e224..e31e956 100644
--- a/client/site_tests/platform_CrosDisksFilesystem/ext4_tests
+++ b/client/site_tests/platform_CrosDisksFilesystem/ext4_tests
@@ -6,7 +6,8 @@
"filesystem_type": "ext4",
"mkfs_options": [ "-L", "MyDisk" ],
"test_mount_options": [ "ro", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/MyDisk"
},
{
"description": "ext4 filesystem with UUID (read)",
@@ -15,7 +16,8 @@
"filesystem_type": "ext4",
"mkfs_options": [ "-U", "01234567-89ab-cdef-0123-456789abcdef" ],
"test_mount_options": [ "ro", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/External Drive"
},
{
"description": "ext4 filesystem (write)",
@@ -25,6 +27,7 @@
"filesystem_type": "ext4",
"mkfs_options": [ "-L", "MyDisk" ],
"test_mount_options": [ "rw", "nodev", "noexec", "nosuid", "sync" ],
- "expected_mount_status": 102
+ "expected_mount_status": 0,
+ "expected_mount_path": "/media/removable/MyDisk"
}
]
diff --git a/client/site_tests/platform_CrosDisksFilesystem/platform_CrosDisksFilesystem.py b/client/site_tests/platform_CrosDisksFilesystem/platform_CrosDisksFilesystem.py
index 5eb6d37..296f73d 100644
--- a/client/site_tests/platform_CrosDisksFilesystem/platform_CrosDisksFilesystem.py
+++ b/client/site_tests/platform_CrosDisksFilesystem/platform_CrosDisksFilesystem.py
@@ -2,14 +2,18 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import dbus
+import glob
import logging
import json
+import os
import tempfile
from autotest_lib.client.bin import test
from autotest_lib.client.bin import utils
from autotest_lib.client.common_lib import error
from autotest_lib.client.cros.cros_disks import CrosDisksTester
+from autotest_lib.client.cros.cros_disks import ExceptionSuppressor
from autotest_lib.client.cros.cros_disks import VirtualFilesystemImage
from autotest_lib.client.cros.cros_disks import DefaultFilesystemTestContent
@@ -86,18 +90,13 @@
actual_mount_path = result['mount_path']
- # Perform read/write tests only if the mount operation succeeds.
- if result['status'] == 0:
- # If it is a write test, create the test content on the
- # filesystem after it is mounted by CrosDisks.
- if is_write_test and not test_content.create(actual_mount_path):
- raise error.TestFail(
- "Failed to create filesystem test content")
+ # If it is a write test, create the test content on the filesystem
+ # after it is mounted by CrosDisks.
+ if is_write_test and not test_content.create(actual_mount_path):
+ raise error.TestFail("Failed to create filesystem test content")
- if not test_content.verify(actual_mount_path):
- raise error.TestFail(
- "Failed to verify filesystem test content")
-
+ if not test_content.verify(actual_mount_path):
+ raise error.TestFail("Failed to verify filesystem test content")
self.cros_disks.unmount(device_file, ['force'])
def test_using_virtual_filesystem_image(self):