[Fuego] [PATCH] LTP_Smack: add a new job to test "smack" module

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Fri Jul 6 08:30:52 UTC 2018


Hi Li, Tim

> -----Original Message-----
> From: fuego-bounces at lists.linuxfoundation.org
> <fuego-bounces at lists.linuxfoundation.org> On Behalf Of Li, Xiaoming
[...]
> diff --git a/engine/tests/Functional.LTP_Smack/test_mount.sh
> b/engine/tests/Functional.LTP_Smack/test_mount.sh
> new file mode 100644
> index 0000000..9d78154
> --- /dev/null
> +++ b/engine/tests/Functional.LTP_Smack/test_mount.sh
> @@ -0,0 +1,28 @@
> +#!/bin/sh
> +
> +if [ "$1" == "start" ]; then
> +    touch test_mount.log
> +    mount | grep -v /sys/fs/smackfs | grep /smack > /dev/null
> +    if [ $? -eq 0 ]; then
> +        exit 0
> +    fi
> +
> +    if [ ! -d /smack ]; then
> +        mkdir /smack > /dev/null
> +        echo "NEW_DIR" >> test_mount.log
> +    fi
> +
> +    mount -t smackfs smackfs /smack
> +    echo "NEW_MOUNT" >> test_mount.log
> +fi
> +
> +
> +if [ "$1" == "end" ]; then
> +    if grep "NEW_MOUNT" test_mount.log > /dev/null; then
> +        umount /smack
> +    fi
> +
> +    if grep "NEW_DIR" test_mount.log > /dev/null; then
> +        rmdir /smack
> +    fi
> +fi

This could be added as prechecks in LTP (note that it requires root permissions). 
But I think we don't need to mount it for the user, just check that smack is ready and report otherwise should be fine.
Additionally, checking the SMACK Kconfig values in the target board's kernel configuration would be helpful.
What do you think Tim?

Best regards,
Daniel





More information about the Fuego mailing list