[rhinstaller/anaconda/pulls/199 master] Kickstart service test: enable / disable.

vpodzime installerbot-noreply at redhat.com
Mon Jul 20 06:02:53 UTC 2015


> @@ -0,0 +1,56 @@
> +#version=DEVEL
> +url --url="http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basearch/os/"
> +install
> +network --bootproto=dhcp
> +
> +bootloader --timeout=1
> +zerombr
> +clearpart --all --initlabel
> +autopart
> +
> +keyboard en
> +lang en
> +timezone America/New_York --utc
> +rootpw testcase
> +
> +# Test services
> +services --disabled=sshd --enabled=systemd-timesyncd
> +
> +# Test SELinux
> +selinux --enforcing
> +
> +shutdown
> +
> +%packages
> +%end
> +
> +%post
> +
> +# Test enabled
> +systemctl is-enabled systemd-timesyncd | grep enabled
> +if [[ $? -ne 0 ]]; then
> +    echo "*** systemd-timesyncd is disabled, not enabled" >> /root/RESULT
> +fi
> +
> +# Test disabled
> +systemctl is-enabled sshd | grep disabled
> +if [[ $? -ne 0 ]]; then
> +    echo "*** sshd is enabled, not disabled" >> /root/RESULT
> +fi
> +
> +# Test disabled - W/out change
> +systemctl is-enabled systemd-networkd | grep disabled
> +if [[ $? -ne 0 ]]; then
> +    echo "*** systemd-networkd is enabled, should be disabled" >> /root/RESULT
> +fi

You could drop the ``|grep ...`` parts as ``systemctl is-enabled`` exits with the code 0/1 if the service is enabled/disabled.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/199#discussion_r34969645


More information about the anaconda-patches mailing list