All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] Functional.fuse - WARNING!! it can wipe your rootfs
@ 2018-08-02  1:09 Tim.Bird
  0 siblings, 0 replies; only message in thread
From: Tim.Bird @ 2018-08-02  1:09 UTC (permalink / raw)
  To: Tim.Bird, lixm.fnst, fuego

OK - so there's an rm -rf at the end of fuse_test.sh (which is part
of Functional.fuse) that wiped out the root filesystem on two of my
boards.  I spent some time today recovering.  I've eliminated the
mounting of fusexmp from this test, as it is inherently dangerous
in this way, and doesn't really add much, IMHO, to this test.

I would much rather see fioclient and fselclient used to test features
of those user-space filesystems, instead of mounting this dangerous filesystem.

What happened for me was that the fusermount tool failed to unmount
fusexmp, and since my Fuego test user was root, I started deleting stuff
in the (mirrored) root.  Ugh.  This is a dangerous operation, and I'm not even
sure why it's there.  I decided to remove the 'rm -rf' operation, as well
as the use of fusexmp, since Fuego also does an 'rf -rf' of the board
test directory as part of its normal cleanup.

Patches for Functional.fuse have been applied and pushed to master.
 -- Tim


> -----Original Message-----
> From: Tim.Bird@sony.com
> 
> In testing this patch, I have a few boards that now spin forever
> on the "rm -rf $test_path/fuse" operation at the end of the test.
> 
> I think before I applied the patch, some previous operation was failing
> and the contents of fuego.Functional.fuse/fuse/test_fusexmp were not
> valid.  Now, the root filesystem appears to be showing up in the fuse
> areas.  Specifically, I have sys, home, and others trying to be deleted
> in fuego.Functional.fuse/fuse/test_fusexmp.  Since 'home' is present, it
> causes recursion in the directory processing for the 'rm -rf'
> 
> I have run out of time to investigate this today, but overall I think I
> need to eliminate the 'rm -rf' operation at the end of the test,
> or somehow prevent it from recursing.   These errors are making
> it difficult to test the fixes performed by the patch.  I'll work on this
> more tomorrow and let you know what I see.
> 
> Thanks,
>  -- Tim
> 
> 
> > -----Original Message-----
> > From: Li Xiaoming
> > Sent: Monday, July 30, 2018 8:45 PM
> > To: fuego@lists.linuxfoundation.org
> > Subject: [Fuego] [PATCH 2/2] Functional.fuse: fixed build error
> >
> > Details: solved 2 problems:
> > 1) copy the missing .so files to board
> > 2) calls fusermount with full path as the default env does not include it
> >
> > Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
> > ---
> >  engine/tests/Functional.fuse/fuego_test.sh | 12 ++++++++++++
> >  engine/tests/Functional.fuse/fuse_test.sh  |  8 ++++----
> >  2 files changed, 16 insertions(+), 4 deletions(-)
> >
> > diff --git a/engine/tests/Functional.fuse/fuego_test.sh
> > b/engine/tests/Functional.fuse/fuego_test.sh
> > index 2d6405a..94c4bd2 100755
> > --- a/engine/tests/Functional.fuse/fuego_test.sh
> > +++ b/engine/tests/Functional.fuse/fuego_test.sh
> > @@ -1,4 +1,6 @@
> >  tarball=fuse-2.9.4.tar.gz
> > +LIB_FUSE=""
> > +NEED_ROOT=1
> >
> >  function test_build {
> >      echo "fuse test build"
> > @@ -7,16 +9,26 @@ function test_build {
> >      patch -p1 -N < $TEST_HOME/patch_files/gold-unversioned-
> symbol.patch
> >      ./configure --host=$PREFIX
> >      make
> > +    cp util/fusermount  example/.libs
> >      tar cjf fuse_test_libs.tar.bz2 example/.libs
> >  }
> >
> >  function test_deploy {
> >      put fuse_test_libs.tar.bz2 $BOARD_TESTDIR/fuego.$TESTDIR/;
> >      put $TEST_HOME/fuse_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/;
> > +
> > +    is_on_target libfuse.so.2 LIB_FUSE /usr/lib
> > +    if [ -z $LIB_FUSE ]; then
> > +        put lib/.libs/libfuse.so.2.9.4 /usr/lib/
> > +        cmd "ln -sf /usr/lib/libfuse.so.2.9.4 /usr/lib/libfuse.so.2"
> > +    fi
> >  }
> >
> >  function test_run {
> >      report "cd $BOARD_TESTDIR/fuego.$TESTDIR; sh -v fuse_test.sh"
> > +    if [ -z $LIB_FUSE ]; then
> > +        cmd "rm /usr/lib/libfuse.so.2.9.4 ; rm /usr/lib/libfuse.so.2"
> > +    fi
> >  }
> >
> >  function test_processing {
> > diff --git a/engine/tests/Functional.fuse/fuse_test.sh
> > b/engine/tests/Functional.fuse/fuse_test.sh
> > index 250b642..ab59d45 100755
> > --- a/engine/tests/Functional.fuse/fuse_test.sh
> > +++ b/engine/tests/Functional.fuse/fuse_test.sh
> > @@ -11,7 +11,7 @@ fi;
> >  if cat $test_path/fuse/test_hello/hello | grep "Hello World!"; then
> >      echo 'TEST-2 OK'; else echo 'TEST-2 FAIL';
> >  fi;
> > -if fusermount -u $test_path/fuse/test_hello; then
> > +if ./fusermount -u $test_path/fuse/test_hello; then
> >      echo 'TEST-3 OK'; else echo 'TEST-3 FAIL';
> >  fi;
> >
> > @@ -21,7 +21,7 @@ if ./fioc -o allow_other -o sync_read -o nonempty \
> >      -o kernel_cache $test_path/fuse/test_fioc; then
> >      echo 'TEST-4 OK'; else echo 'TEST-4 FAIL';
> >  fi;
> > -if fusermount -u $test_path/fuse/test_fioc/; then
> > +if ./fusermount -u $test_path/fuse/test_fioc/; then
> >      echo 'TEST-5 OK'; else echo 'TEST-5 FALL';
> >  fi;
> >
> > @@ -31,7 +31,7 @@ if ./fsel -o allow_other -o sync_read -o nonempty \
> >      -o kernel_cache $test_path/fuse/test_fsel; then
> >      echo 'TEST-6 OK'; else echo 'TEST-6 FAIL';
> >  fi;
> > -if fusermount -u $test_path/fuse/test_fsel/; then
> > +if ./fusermount -u $test_path/fuse/test_fsel/; then
> >      echo 'TEST-7 OK'; else echo 'TEST-7 FALL';
> >  fi;
> >
> > @@ -41,7 +41,7 @@ if ./fusexmp -o allow_other -o sync_read -o
> nonempty \
> >      $test_path/fuse/test_fusexmp; then
> >      echo 'TEST-8 OK'; else echo 'TEST-8 FAIL';
> >  fi;
> > -if fusermount -u $test_path/fuse/test_fusexmp/; then
> > +if ./fusermount -u $test_path/fuse/test_fusexmp/; then
> >      echo 'TEST-9 OK'; else echo 'TEST-9 FALL';
> >  fi;
> >  rm -rf $test_path/fuse;
> > --
> > 2.7.4
> >
> >
> >
> > _______________________________________________
> > Fuego mailing list
> > Fuego@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/fuego
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-02  1:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-02  1:09 [Fuego] Functional.fuse - WARNING!! it can wipe your rootfs Tim.Bird

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.