cros-disks unit tests fail on loopback device |
|||
Issue descriptionWhen the root device inside the chroot is a loopback device, cros-disks unit tests fail to find the root device.
,
Jul 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/4e1b25b832074338b930c2d4748f6be14cf5a26f commit 4e1b25b832074338b930c2d4748f6be14cf5a26f Author: Benjamin Gordon <bmgordon@chromium.org> Date: Wed Jul 26 23:46:50 2017 cros-disks: Support loopback root in unit tests The unit tests currently assume that the root device is 1. Not the same device as /dev/loop0 by name 2. Not a loopback device in general 3. On a partitioned disk These assumptions become incorrect as soon as the chroot is mounted from a loopback device (coming in crrev.com/c/553462). Fix these assumptions by explicitly searching for devices that have the necessary properties. BUG= chromium:748665 , chromium:730144 TEST=Ran unit tests inside a loopback-based chroot and regular chroot. Change-Id: I176332790d3c9fa6a8555784c6716bcbab151e62 Reviewed-on: https://chromium-review.googlesource.com/585694 Commit-Ready: Benjamin Gordon <bmgordon@chromium.org> Tested-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/4e1b25b832074338b930c2d4748f6be14cf5a26f/cros-disks/udev_device_unittest.cc
,
Jul 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/rootdev/+/fc570685c1ca4acb871c706a66d0493b5e92c7c9 commit fc570685c1ca4acb871c706a66d0493b5e92c7c9 Author: Benjamin Gordon <bmgordon@chromium.org> Date: Fri Jul 28 22:04:27 2017 rootdev: Strip partitions less aggressively In device names like dm-N or loopN, the N is not a partition number and should not be stripped off. These can arise for example if run inside a chroot mounted on a loopback device. BUG= chromium:748665 , chromium:730144 TEST=New unit tests. Change-Id: If7ecacbfcf00690376cb4ffc75baa45422579085 Reviewed-on: https://chromium-review.googlesource.com/585652 Commit-Ready: Benjamin Gordon <bmgordon@chromium.org> Tested-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/fc570685c1ca4acb871c706a66d0493b5e92c7c9/rootdev_test.sh [modify] https://crrev.com/fc570685c1ca4acb871c706a66d0493b5e92c7c9/rootdev.c
,
Aug 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/bda72e34c19dd1320b6aff64fd256bac0b9a4bf3 commit bda72e34c19dd1320b6aff64fd256bac0b9a4bf3 Author: Benjamin Gordon <bmgordon@chromium.org> Date: Tue Aug 01 21:39:53 2017 cros-disks: Fix GetBootDevicePath in unit tests rootdev() returns 0 on success, so GetBootDevicePath has been testing the result backwards. I think this has been working in the past because rootdev sometimes sets the path even when it fails and most of the tests didn't depend on having the correct boot device. The incorrect logic started failing when the chroot is on a loopback device for x86_64 boards. BUG= chromium:748665 , chromium:730144 TEST=Sent to trybots with http://crrev.com/c/553462 to confirm inside a loopback-based chroot. Change-Id: Id6ed829667f0055ce6e6ddde292bad18ddc253a3 Reviewed-on: https://chromium-review.googlesource.com/596408 Commit-Ready: Benjamin Gordon <bmgordon@chromium.org> Tested-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> [modify] https://crrev.com/bda72e34c19dd1320b6aff64fd256bac0b9a4bf3/cros-disks/udev_device_unittest.cc
,
Aug 2 2017
,
Jan 22 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by bmgordon@chromium.org
, Jul 25 2017