All of lore.kernel.org
 help / color / mirror / Atom feed
* [v2] test: Have test_fs work with non-functional guestmount tools
@ 2020-07-09 13:42 Tom Rini
  2020-07-09 17:07 ` Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tom Rini @ 2020-07-09 13:42 UTC (permalink / raw)
  To: u-boot

Since 2011 Ubuntu has intentionally broken support for guestmount[1] by
default and requires sysadmin intervention to re-enable support.  This
in turn exposed that in our tests if guestmount is available but fails
we do not fall back to trying to use sudo.  Restructure our code to try
sudo if guestmount fails rather than only when it is not in our path.
Further, only note that we are using fuse on success of the call.

[1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v2:
- Rework to not have another try/except nesting as Stephen suggested.
  Tested this out and we still skip the tests and now note that sudo
  doesn't work.  Since the README for tests says sudo or guestmount, I
  think this is OK.

This, I suspect, will also fix the cases where in CI we attempt to run
the FS tests but do not as guestmount fails.  I'm not going to remove
guestmount from the Docker containers as it's a useful reference for
"what is required for a minimal environment for U-Boot builds" and
perhaps we will switch to Debian instead at some point.
---
 test/py/tests/test_fs/conftest.py | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py
index ee82169c2a37..188b9b1ddef8 100644
--- a/test/py/tests/test_fs/conftest.py
+++ b/test/py/tests/test_fs/conftest.py
@@ -206,21 +206,19 @@ def mount_fs(fs_type, device, mount_point):
     fuse_mounted = False
     try:
         if tool_is_in_path('guestmount'):
-            fuse_mounted = True
             check_call('guestmount -a %s -m /dev/sda %s'
                 % (device, mount_point), shell=True)
-        else:
-            mount_opt = 'loop,rw'
-            if re.match('fat', fs_type):
-                mount_opt += ',umask=0000'
+            fuse_mounted = True
+    except CalledProcessError:
+        mount_opt = 'loop,rw'
+        if re.match('fat', fs_type):
+            mount_opt += ',umask=0000'
 
-            check_call('sudo mount -o %s %s %s'
-                % (mount_opt, device, mount_point), shell=True)
+        check_call('sudo mount -o %s %s %s'
+            % (mount_opt, device, mount_point), shell=True)
 
-            # may not be effective for some file systems
-            check_call('sudo chmod a+rw %s' % mount_point, shell=True)
-    except CalledProcessError:
-        raise
+        # may not be effective for some file systems
+        check_call('sudo chmod a+rw %s' % mount_point, shell=True)
 
 def umount_fs(mount_point):
     """Unmount a volume.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [v2] test: Have test_fs work with non-functional guestmount tools
  2020-07-09 13:42 [v2] test: Have test_fs work with non-functional guestmount tools Tom Rini
@ 2020-07-09 17:07 ` Stephen Warren
  2020-07-09 18:02 ` Simon Glass
  2020-07-15 19:51 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Warren @ 2020-07-09 17:07 UTC (permalink / raw)
  To: u-boot

On 7/9/20 7:42 AM, Tom Rini wrote:
> Since 2011 Ubuntu has intentionally broken support for guestmount[1] by
> default and requires sysadmin intervention to re-enable support.  This
> in turn exposed that in our tests if guestmount is available but fails
> we do not fall back to trying to use sudo.  Restructure our code to try
> sudo if guestmount fails rather than only when it is not in our path.
> Further, only note that we are using fuse on success of the call.
> 
> [1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725

Reviewed-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [v2] test: Have test_fs work with non-functional guestmount tools
  2020-07-09 13:42 [v2] test: Have test_fs work with non-functional guestmount tools Tom Rini
  2020-07-09 17:07 ` Stephen Warren
@ 2020-07-09 18:02 ` Simon Glass
  2020-07-15 19:51 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2020-07-09 18:02 UTC (permalink / raw)
  To: u-boot

On Thu, 9 Jul 2020 at 07:42, Tom Rini <trini@konsulko.com> wrote:
>
> Since 2011 Ubuntu has intentionally broken support for guestmount[1] by
> default and requires sysadmin intervention to re-enable support.  This
> in turn exposed that in our tests if guestmount is available but fails
> we do not fall back to trying to use sudo.  Restructure our code to try
> sudo if guestmount fails rather than only when it is not in our path.
> Further, only note that we are using fuse on success of the call.
>
> [1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725
>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stephen Warren <swarren@nvidia.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Changes in v2:
> - Rework to not have another try/except nesting as Stephen suggested.
>   Tested this out and we still skip the tests and now note that sudo
>   doesn't work.  Since the README for tests says sudo or guestmount, I
>   think this is OK.
>
> This, I suspect, will also fix the cases where in CI we attempt to run
> the FS tests but do not as guestmount fails.  I'm not going to remove
> guestmount from the Docker containers as it's a useful reference for
> "what is required for a minimal environment for U-Boot builds" and
> perhaps we will switch to Debian instead at some point.
> ---
>  test/py/tests/test_fs/conftest.py | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [v2] test: Have test_fs work with non-functional guestmount tools
  2020-07-09 13:42 [v2] test: Have test_fs work with non-functional guestmount tools Tom Rini
  2020-07-09 17:07 ` Stephen Warren
  2020-07-09 18:02 ` Simon Glass
@ 2020-07-15 19:51 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2020-07-15 19:51 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 09, 2020 at 09:42:25AM -0400, Tom Rini wrote:

> Since 2011 Ubuntu has intentionally broken support for guestmount[1] by
> default and requires sysadmin intervention to re-enable support.  This
> in turn exposed that in our tests if guestmount is available but fails
> we do not fall back to trying to use sudo.  Restructure our code to try
> sudo if guestmount fails rather than only when it is not in our path.
> Further, only note that we are using fuse on success of the call.
> 
> [1]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725
> 
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stephen Warren <swarren@nvidia.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Stephen Warren <swarren@nvidia.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

So, I'm rejecting this patch.  While it fixes the tests running under
GitLab, when the runner is configured correctly:
https://gitlab.denx.de/u-boot/u-boot/-/jobs/124997
It causes Travis to fail the tests now:
https://travis-ci.org/github/trini/u-boot/jobs/708328027
whereas the usually are run and pass:
https://travis-ci.org/github/trini/u-boot/jobs/708035304

And in neither case are these all run on Azure:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=909&view=logs&j=50449d1b-398e-53ae-48fa-6bf338edeb51&t=97605dd2-f5a5-5dd7-2118-315ffdc8bcd6

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200715/a40dd75b/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-15 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 13:42 [v2] test: Have test_fs work with non-functional guestmount tools Tom Rini
2020-07-09 17:07 ` Stephen Warren
2020-07-09 18:02 ` Simon Glass
2020-07-15 19:51 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.