From Fedora Project Wiki

(render the <pre> tag correctly)
(drop the bug note, as it's fixed)
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Template:Associated_release_criterion|Beta|kickstart-delivery}}
{{QA/Test_Case
{{QA/Test_Case
|description=
|description=
This test will verify that anaconda can load a kickstart file from a file:// path.  This is a typical case for when the kickstart file is located in the initrd or stage#1 environment.
This test will verify that anaconda can load a kickstart file from a {{filename|file://}} path.  This is a typical case for when the kickstart file is located in the {{filename|initrd.img}}.
|actions=
|actions=
# Prepare a valid kickstart file. For help creating a kickstart file, examine the file {{filename|/root/anaconda-ks.cfg}} on a previously installed system.  This file contains the kickstart instructions used to install that system.  For additional guidance on kickstart syntax, see [[Anaconda/Kickstart]].
<ol>
# Download the installer initial ramdisk.  The ramdisk is typically called {{filename|images/pxeboot/initrd.img}}.
<li> Prepare a valid kickstart file. For help creating a kickstart file, examine the file {{filename|/root/anaconda-ks.cfg}} on a previously installed system.  This file contains the kickstart instructions used to install that system.  For additional guidance on kickstart syntax, see [[Anaconda/Kickstart]]
# Place the kickstart file into the root directory of the installer initial ramdisk using the {{command|pax}} command.  For example,
<li>Now you need to place your kickstart file inside the ramdisk. You can either do that manually, or use <code>--initrd-inject</code> option of {{package|python-virtinst}} tool, if you use it:
## Untar the ramdisk: <pre>zcat initrd.img > initrd.cpio</pre>
<ul>
## Add the kickstart file: <pre>pax -w -a -f initrd.cpio ks.cfg</pre>
<li>'''Option #1 - using a virt-install''':
## Compress the image: <pre>gzip -c initrd.cpio > initrd.img</pre>
Use <code>--initrd-inject &lt;kickstart&gt;</code> and <code>--extra-args "ks=file:/&lt;kickstart&gt;"</code> command line arguments. An example command would look like this (you need to change the ''location'' at least):
# Boot into the installer using any available means
{{#tag:pre|virt-install --name FedoraTest --ram 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/{{FedoraVersionNumber|next|short}}-Alpha-RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "ks=file:/ks.cfg"}}</li>
# At the bootloader prompt, provide a location for the kickstart file at the boot prompt.  Using the example above: <pre>linux ks=file:///ks.cfg </pre>
<li>'''Option #2 - modifying ramdisk manually''':
<ol>
<li> Download the installer initial ramdisk.  The ramdisk is typically called {{filename|images/pxeboot/initrd.img}}
<li> Place the kickstart file into the root directory of the installer initial ramdisk using the {{command|cpio}} command.  <pre>echo ks.cfg | cpio -c -o >> initrd.img</pre>
<li> Boot into the installer kernel ({{filename|vmlinuz}}) and the modified initial ramdisk ({{filename|initrd.img}}) using any available means (PXE, virt-install, virt-manager, etc)
<li> At the bootloader prompt, provide a location for the kickstart file at the boot prompt.  Using the example above: <pre>ks=file:///ks.cfg </pre>
You also need to provide <code>[[Anaconda/Options#stage2|stage2=]]</code> boot option for Anaconda to start correctly.
</ol>
</ul>
</li>
</ol>
|results=
|results=
<ol>
<ol>
<li> Confirm the ks.cfg is included in the initial ramdisk.</li>
<li> Confirm the {{filename|ks.cfg}} is included in the initial ramdisk using <code>lsinitrd initrd.img {{!}} grep ks.cfg</code> command.
<pre>zcat initrd.img | pax | grep ks.cfg
<li> The installer successfully initiates a kickstart install in accordance with the instructions supplied by the {{filename|ks.cfg}} file included in the initial ramdisk. To ensure the kickstart file is properly loaded, inspect the {{filename|anaconda.log}} for a lines similar to the following:
  ks.cfg </pre>
<pre>
</li>
15:44:56,189 INFO loader: kernel command line:
<li> The ks.cfg is successfully obtained from the specified location</li>
15:44:56,189 INFO loader:    ks=file:///ks.cfg
<li> The install should proceed in accordance with the directives in the ks.cfg file</li>
...
15:44:59,274 INFO loader: getting kickstart file
15:44:59,274 INFO loader: setting up kickstart
...
15:44:59,906 INFO loader: doing kickstart... setting it up
</pre>
<li> The installer should honor the kickstart commands provided in the {{filename|ks.cfg}} file </li>
<li> If sufficient commands are provided to fully automate an installation, the installer must not prompt for user input.</li>
</ol>
</ol>
}}
}}


[[Category:Kickstart Delivery]]
[[Category:Kickstart Delivery]]

Revision as of 05:05, 10 December 2013

Note.png
Associated release criterion
This test case is associated with the Fedora_41_Beta_Release_Criteria#kickstart-delivery release criterion. If you are doing release validation testing, a failure of this test case may be a breach of that release criterion. If so, please file a bug and nominate it as blocking the appropriate milestone, using the blocker bug nomination page.


Description

This test will verify that anaconda can load a kickstart file from a file:// path. This is a typical case for when the kickstart file is located in the initrd.img.


How to test

  1. Prepare a valid kickstart file. For help creating a kickstart file, examine the file /root/anaconda-ks.cfg on a previously installed system. This file contains the kickstart instructions used to install that system. For additional guidance on kickstart syntax, see Anaconda/Kickstart
  2. Now you need to place your kickstart file inside the ramdisk. You can either do that manually, or use --initrd-inject option of Package-x-generic-16.pngpython-virtinst tool, if you use it:
    • Option #1 - using a virt-install: Use --initrd-inject <kickstart> and --extra-args "ks=file:/<kickstart>" command line arguments. An example command would look like this (you need to change the location at least):
      virt-install --name FedoraTest --ram 1024 --disk pool=default,size=10 --location http://dl.fedoraproject.org/pub/alt/stage/41-Alpha-RC4/Fedora/x86_64/os/ --initrd-inject ks.cfg --extra-args "ks=file:/ks.cfg"
    • Option #2 - modifying ramdisk manually:
      1. Download the installer initial ramdisk. The ramdisk is typically called images/pxeboot/initrd.img
      2. Place the kickstart file into the root directory of the installer initial ramdisk using the cpio command.
        echo ks.cfg | cpio -c -o >> initrd.img
      3. Boot into the installer kernel (vmlinuz) and the modified initial ramdisk (initrd.img) using any available means (PXE, virt-install, virt-manager, etc)
      4. At the bootloader prompt, provide a location for the kickstart file at the boot prompt. Using the example above:
        ks=file:///ks.cfg 

        You also need to provide stage2= boot option for Anaconda to start correctly.

Expected Results

  1. Confirm the ks.cfg is included in the initial ramdisk using lsinitrd initrd.img | grep ks.cfg command.
  2. The installer successfully initiates a kickstart install in accordance with the instructions supplied by the ks.cfg file included in the initial ramdisk. To ensure the kickstart file is properly loaded, inspect the anaconda.log for a lines similar to the following:
    15:44:56,189 INFO loader: kernel command line:
    15:44:56,189 INFO loader:     ks=file:///ks.cfg
    ...
    15:44:59,274 INFO loader: getting kickstart file
    15:44:59,274 INFO loader: setting up kickstart
    ...
    15:44:59,906 INFO loader: doing kickstart... setting it up
    
  3. The installer should honor the kickstart commands provided in the ks.cfg file
  4. If sufficient commands are provided to fully automate an installation, the installer must not prompt for user input.