[anaconda][master][PATCH] Add a simple tmpfs kickstart test

Jiří Konečný jkonecny at redhat.com
Fri May 22 09:00:33 UTC 2015


On Thu, 2015-05-21 at 18:38 +0200, Martin Kolman wrote:
> A simple test for tmpfs support in kickstart (part --fstype=tmpfs).
> Tests that the tmpfs mountpoint is created with correct size and
> mounted during installation and also if it is correctly configured in 
> fstab.
> 
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>  tests/kickstart_tests/tmpfs-fixed_size.ks | 48 
> +++++++++++++++++++++++++++++++
>  tests/kickstart_tests/tmpfs-fixed_size.sh | 48 
> +++++++++++++++++++++++++++++++
>  2 files changed, 96 insertions(+)
>  create mode 100644 tests/kickstart_tests/tmpfs-fixed_size.ks
>  create mode 100755 tests/kickstart_tests/tmpfs-fixed_size.sh
> 
> diff --git a/tests/kickstart_tests/tmpfs-fixed_size.ks 
> b/tests/kickstart_tests/tmpfs-fixed_size.ks
> new file mode 100644
> index 0000000..72cee9c
> --- /dev/null
> +++ b/tests/kickstart_tests/tmpfs-fixed_size.ks
> @@ -0,0 +1,48 @@
> +url --url=http://dl.fedoraproject.org/pub/fedora/linux/development/$
> releasever/$basearch/os/
> +install
> +network --bootproto=dhcp
> +
> +bootloader --timeout=1
> +zerombr
> +clearpart --all
> +
> +part --fstype=ext4 --size=4400 /
> +part --fstype=swap --size=500 swap
> +part --fstype=tmpfs --size 5000 /tmp
> +
> +keyboard us
> +lang en
> +timezone America/New_York
> +rootpw qweqwe
> +shutdown
> +
> +%packages
> + at core
> +%end
> +
> +%post
> +mount | grep -q "tmpfs on /tmp"
> +if [[ $? != 0 ]]; then
> +    echo '*** tmpfs not mounted in /tmp' >> /root/RESULT
> +fi
> +
> +mount | grep "tmpfs on /tmp" | grep -q "size=5120000k"
> +if [[ $? != 0 ]]; then
> +    echo '*** tmpfs size is not 5000 MB' >> /root/RESULT
> +fi
> +
> +cat /etc/fstab | grep -q "tmpfs"
> +if [[ $? != 0 ]]; then
> +    echo '*** tmpfs is not present in fstab' >> /root/RESULT
> +fi
> +
> +cat /etc/fstab | grep "tmpfs" | grep -q "size=5000m"
> +if [[ $? != 0 ]]; then
> +    echo '*** tmpfs size is not 5000 MB in fstab' >> /root/RESULT
> +fi
> +
> +# the installation was successfull if nothing bad happend till now
> +if [[ ! -e /root/RESULT ]]; then
> +        echo SUCCESS > /root/RESULT

Fix the indentation here other than that Ack.


More information about the anaconda-patches mailing list