Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation rules #12

Merged
merged 3 commits into from Mar 18, 2016
Merged
Changes from 2 commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,17 @@
#!/bin/bash
#
# Check that AutoYaST rules were retrieved correctly.
#
set -e -x

Y2LOG=/var/log/YaST2/y2log-1.gz

# mac matches
zgrep -e 'ATTR.*"mac"=>"020000123456"' $Y2LOG

# hostid, hostaddress and network aren't nil
zgrep -e 'ATTR.*"hostid"=>"[^ ]*"' $Y2LOG
zgrep -e 'ATTR.*"hostaddress"=>"[^ ]*"' $Y2LOG
zgrep -e 'ATTR.*"network"=>"[^ ]*"' $Y2LOG

echo "AUTOYAST OK"
@@ -0,0 +1,65 @@
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general>
<mode>
<confirm config:type="boolean">false</confirm>
<second_stage config:type="boolean">false</second_stage>
</mode>
</general>

<software>
<install_recommended config:type="boolean">false</install_recommended>
<patterns config:type="list">
<pattern>Minimal</pattern>
</patterns>
<packages config:type="list">
<!-- An SSH server is needed to perform the integration tests -->
<package>openssh</package>
<!-- The following packages are needed to run postinstall.sh -->
<package>sudo</package>
<package>curl</package>
<package>ca-certificates-mozilla</package>
<!-- Workaround about missing glibc-locale -->
<package>glibc-locale</package>
</packages>
</software>

<users config:type="list">
<user>
<encrypted config:type="boolean">false</encrypted>
<fullname>vagrant</fullname>
<gid>100</gid>
<home>/home/vagrant</home>
<shell>/bin/bash</shell>
<uid>1000</uid>
<user_password>nots3cr3t</user_password>
<username>vagrant</username>
</user>
<user>
<encrypted config:type="boolean">false</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password>nots3cr3t</user_password>
<username>root</username>
</user>
</users>

<scripts>
<chroot-scripts config:type="list">
<script>
<chrooted config:type="boolean">true</chrooted>
<filename>enable-ssh-service.sh</filename>
<interpreter>shell</interpreter>
<source><![CDATA[
#!/bin/sh
/usr/bin/systemctl enable sshd.service
]]>
</source>
</script>
</chroot-scripts>
</scripts>
</profile>
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<autoinstall xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<rules config:type="list">
<rule>
<result>
<profile>profile1.xml</profile>
<continue config:type="boolean">true</continue>
</result>
<operator>and</operator>
</rule>
<rule>
<mac>
<match>020000123456</match>
<match_type>exact</match_type>
</mac>
<result>
<profile>minimal.xml</profile>
<continue config:type="boolean">false</continue>
</result>
<operator>and</operator>
</rule>
</rules>
</autoinstall>
@@ -0,0 +1 @@
autoyast=http://%IP%:{{PORT}}/static/profile/
@@ -0,0 +1,6 @@
user.sh # vagrant user has been created
root.sh # root hast /root home (bnc#878427)
installation_snapshot.sh # snapshot has been created
no_yast2_packages.sh # YaST2 packages are not installed
no_second_stage.sh # second stage was not run
check_rules.sh # Linuxrc are correctly retrieved when evaluating rules (bsc#963137)
@@ -0,0 +1,5 @@
require "aytests/spec_helper"

describe "install rules test" do
include_examples "test_scripts", "rules"
end
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 18 09:02:17 UTC 2016 - igonzalezsosa@suse.com

- Add a test to check if AutoYaST rules were correctly evaluated.

This comment has been minimized.

Copy link
@mvidner

mvidner Mar 18, 2016

Member

Please mention (bsc#963137) also here

This comment has been minimized.

Copy link
@mvidner

mvidner Mar 18, 2016

Member

Never mind, I did that.

- Version 1.0.15

-------------------------------------------------------------------
Tue Feb 23 17:09:17 UTC 2016 - igonzalezsosa@suse.com

@@ -17,7 +17,7 @@


Name: aytests-tests
Version: 1.0.14
Version: 1.0.15
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -30,8 +30,8 @@ License: GPL-3.0
Group: System/YaST
Url: https://github.com/yast/aytests-tests

# Depends on .vars files mechanism.
Recommends: aytests >= 1.0.1
# Depends on the vars substitution in .linuxrc files.
Recommends: aytests >= 1.0.7

%description
Profiles and test scripts for AutoYaST2 integration tests.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.