From Fedora Project Wiki

(Created page with "{{QA/Test_Case |description=This testcase ensures it's possible to use package layering features of rpm-ostree |setup= # Ensure you have a booted Fedora IoT image |actions= #...")
 
(make more generic: change wget to htop (don't think it's included in any base images), mention postgresql as alternative to httpd if httpd is in base image)
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=This testcase ensures it's possible to use package layering features of rpm-ostree
|description=This testcase ensures it's possible to use package layering features of rpm-ostree.
|setup=
|setup=
# Ensure you have a booted Fedora IoT image
# Ensure you have a booted rpm-ostree-based Fedora install (e.g. IoT, CoreOS, Silverblue or Kinoite)
|actions=
|actions=
# Install the 'wget' package
# Install a package for a simple application with no dependencies which is not in the base image, e.g. 'htop'
  <nowiki>
  <nowiki>
# rpm-ostree install wget
# rpm-ostree install htop
Checking out tree 7130f87... done
Checking out tree 7130f87... done
...
...
Line 21: Line 21:
Staging deployment... done
Staging deployment... done
Added:
Added:
   wget-1.20.3-4.fc32.x86_64
   htop-3.2.1-2.fc37.x86_64
Run "systemctl reboot" to start a reboot
Run "systemctl reboot" to start a reboot
</nowiki>
</nowiki>


# Reboot the system
# Reboot the system
# Verify that the 'wget' package is layered succesfully and usable
# Verify that the 'htop' package is layered succesfully and usable
  <nowiki>
  <nowiki>
  rpm-ostree status                               
  rpm-ostree status                               
Line 33: Line 33:
                 BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
                 BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: wget
           LayeredPackages: htop


   ostree://fedora-iot:fedora/devel/x86_64/iot
   ostree://fedora-iot:fedora/devel/x86_64/iot
Line 40: Line 40:
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0


# rpm -q wget                        
# rpm -q htop                        
wget-1.20.3-4.fc32.x86_64
htop-3.2.1-2.fc37.x86_64
# wget --version
# htop --version
GNU Wget 1.20.3 built on linux-gnu.
htop 3.2.1
 
-cares +digest +gpgme +https +ipv6 +iri +large-file +metalink +nls
+ntlm +opie +psl +ssl/gnutls
...
</nowiki>
</nowiki>
# Install 'httpd' which pulls in multiple dependencies
# Install a server-type package which pulls in multiple dependencies, e.g. 'httpd'. If 'httpd' is in the base image, try 'postgresql-server'
  <nowiki>
  <nowiki>
# rpm-ostree install httpd
# rpm-ostree install httpd
Line 78: Line 74:
</nowiki>
</nowiki>
# Reboot host
# Reboot host
# Verify that 'wget' is still layered and 'httpd' is also layered with dependencies
# Verify that 'htop' is still layered and 'httpd' (or 'postgresql-server') is also layered with dependencies (for 'postgresql-server', check that 'postgresql' is also installed)
  <nowiki>
  <nowiki>
# rpm-ostree status
# rpm-ostree status
Line 88: Line 84:
                 BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
                 BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: httpd wget
           LayeredPackages: httpd htop


   ostree://fedora-iot:fedora/devel/x86_64/iot
   ostree://fedora-iot:fedora/devel/x86_64/iot
Line 94: Line 90:
                 BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
                 BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: wget
           LayeredPackages: htop
# rpm -q wget
# rpm -q htop
wget-1.20.3-4.fc32.x86_64
htop-3.2.1-2.fc37.x86_64
# rpm -q httpd
# rpm -q httpd
httpd-2.4.43-1.fc32.x86_64
httpd-2.4.43-1.fc32.x86_64
Line 102: Line 98:
apr-1.7.0-3.fc32.x86_64
apr-1.7.0-3.fc32.x86_64
</nowiki>
</nowiki>
# Verify that you can start the 'httpd' service and connect to the server
# Verify that you can start the 'httpd' service and connect to the server. For postgresql, run {{command|/usr/bin/postgresql-setup --initdb}} then start and test the 'postgresql' service, and run {{command|su postgres -c "psql -l"}} to check that it works
  <nowiki>
  <nowiki>
# systemctl start httpd
# systemctl start httpd
Line 135: Line 131:
...
...
</nowiki>
</nowiki>
Enable the httpd service to start at boot and reboot the system.  
Enable the httpd (or postgresql) service to start at boot and reboot the system.  
  systemctl enable httpd
  systemctl enable httpd
  Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
  Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Line 152: Line 148:
...     
...     


# Uninstall 'wget' and 'httpd'
# Uninstall 'htop' and 'httpd' (or 'postgresql-server')
  <nowiki>
  <nowiki>
# rpm-ostree uninstall wget httpd
# rpm-ostree uninstall htop httpd
Staging deployment... done
Staging deployment... done
Removed:
Removed:
Line 171: Line 167:
</nowiki>
</nowiki>
# Reboot host
# Reboot host
# Verify that 'wget' and 'httpd' are no longer layered and cannot be used
# Verify that 'htop' and 'httpd' (or 'postgresql-server') are no longer layered and cannot be used
  <nowiki>
  <nowiki>
# rpm-ostree status
# rpm-ostree status
Line 187: Line 183:
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
               GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: httpd wget
           LayeredPackages: httpd wget
# rpm -q wget
# rpm -q htop
package wget is not installed
package htop is not installed
# rpm -q httpd
# rpm -q httpd
package httpd is not installed
package httpd is not installed
# wget --version
# htop --version
bash: wget: command not found
bash: htop: command not found
# systemctl status httpd
# systemctl status httpd
Unit httpd.service could not be found.
Unit httpd.service could not be found.
Line 200: Line 196:
}}
}}
[[Category:IoT_Acceptance_Test_Cases]]
[[Category:IoT_Acceptance_Test_Cases]]
[[Category:Base_Acceptance_Test_Cases]]

Revision as of 17:10, 16 December 2022

Description

This testcase ensures it's possible to use package layering features of rpm-ostree.

Setup

  1. Ensure you have a booted rpm-ostree-based Fedora install (e.g. IoT, CoreOS, Silverblue or Kinoite)

How to test

  1. Install a package for a simple application with no dependencies which is not in the base image, e.g. 'htop'
# rpm-ostree install htop
Checking out tree 7130f87... done
...
Resolving dependencies... done
Will download: 1 package (815.9?kB)
Downloading from 'updates-testing'... done
Importing packages... done
Checking out packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Added:
  htop-3.2.1-2.fc37.x86_64
Run "systemctl reboot" to start a reboot

  1. Reboot the system
  2. Verify that the 'htop' package is layered succesfully and usable
 rpm-ostree status                               
* ostree://fedora-iot:fedora/devel/x86_64/iot
                   Version: 32.20200408.0 (2020-04-08T11:07:02Z)
                BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: htop

  ostree://fedora-iot:fedora/devel/x86_64/iot
                   Version: 32.20200408.0 (2020-04-08T11:07:02Z)
                    Commit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0

# rpm -q htop                        
htop-3.2.1-2.fc37.x86_64
# htop --version
htop 3.2.1

  1. Install a server-type package which pulls in multiple dependencies, e.g. 'httpd'. If 'httpd' is in the base image, try 'postgresql-server'
# rpm-ostree install httpd
Checking out tree 7130f87... done
...
Downloading from 'fedora'... done
Downloading from 'updates-testing'... done
Importing packages... done
Checking out packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Added:
  apr-1.7.0-3.fc32.x86_64
  apr-util-1.6.1-12.fc32.x86_64
  apr-util-bdb-1.6.1-12.fc32.x86_64
  apr-util-openssl-1.6.1-12.fc32.x86_64
  fedora-logos-httpd-30.0.2-4.fc32.noarch
  httpd-2.4.43-1.fc32.x86_64
  httpd-filesystem-2.4.43-1.fc32.noarch
  httpd-tools-2.4.43-1.fc32.x86_64
  mailcap-2.1.48-7.fc32.noarch
  mod_http2-1.15.5-1.fc32.x86_64
Run "systemctl reboot" to start a reboot

  1. Reboot host
  2. Verify that 'htop' is still layered and 'httpd' (or 'postgresql-server') is also layered with dependencies (for 'postgresql-server', check that 'postgresql' is also installed)
# rpm-ostree status
State: idle
AutomaticUpdates: disabled
Deployments:
* ostree://fedora-iot:fedora/devel/x86_64/iot
                   Version: 32.20200408.0 (2020-04-08T11:07:02Z)
                BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: httpd htop

  ostree://fedora-iot:fedora/devel/x86_64/iot
                   Version: 32.20200408.0 (2020-04-08T11:07:02Z)
                BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: htop
# rpm -q htop
htop-3.2.1-2.fc37.x86_64
# rpm -q httpd
httpd-2.4.43-1.fc32.x86_64
# rpm -q apr
apr-1.7.0-3.fc32.x86_64

  1. Verify that you can start the 'httpd' service and connect to the server. For postgresql, run /usr/bin/postgresql-setup --initdb then start and test the 'postgresql' service, and run su postgres -c "psql -l" to check that it works
# systemctl start httpd
# systemctl status httpd
● httpd.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-04-08 15:36:17 CDT; 4s ago
       Docs: man:httpd.service(8)
   Main PID: 2333 (httpd)
     Status: "Processing requests..."
      Tasks: 213 (limit: 9245)
     Memory: 20.1M
        CPU: 172ms
     CGroup: /system.slice/httpd.service
             ├─2333 /usr/sbin/httpd -DFOREGROUND
             ├─2334 /usr/sbin/httpd -DFOREGROUND
             ├─2335 /usr/sbin/httpd -DFOREGROUND
             ├─2336 /usr/sbin/httpd -DFOREGROUND
             └─2337 /usr/sbin/httpd -DFOREGROUND

Apr 08 15:36:17 fitlet2 systemd[1]: Starting The Apache HTTP Server...
Apr 08 15:36:17 fitlet2 httpd[2333]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 19>
Apr 08 15:36:17 fitlet2 systemd[1]: Started The Apache HTTP Server.


# curl http://localhost                                                  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">        
                                                                       
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">                                                                                                                                                
        <head>                                   
                <title>Test Page for the Apache HTTP Server on Fedora</title>                                                                                                                                                      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />              
...

Enable the httpd (or postgresql) service to start at boot and reboot the system.

systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
systemctl reboot

Log back into the system and make sure the httpd service is running.

systemctl status httpd

● httpd.service - The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
    Active: active (running) since Wed 2020-04-08 15:39:44 CDT; 5s ago
      Docs: man:httpd.service(8)
  Main PID: 1251 (httpd)
    Status: "Processing requests..."
     Tasks: 213 (limit: 9245)

...

  1. Uninstall 'htop' and 'httpd' (or 'postgresql-server')
# rpm-ostree uninstall htop httpd
Staging deployment... done
Removed:
  apr-1.7.0-3.fc32.x86_64
  apr-util-1.6.1-12.fc32.x86_64
  apr-util-bdb-1.6.1-12.fc32.x86_64
  apr-util-openssl-1.6.1-12.fc32.x86_64
  fedora-logos-httpd-30.0.2-4.fc32.noarch
  httpd-2.4.43-1.fc32.x86_64
  httpd-filesystem-2.4.43-1.fc32.noarch
  httpd-tools-2.4.43-1.fc32.x86_64
  mailcap-2.1.48-7.fc32.noarch
  mod_http2-1.15.5-1.fc32.x86_64
  wget-1.20.3-4.fc32.x86_64
Run "systemctl reboot" to start a reboot

  1. Reboot host
  2. Verify that 'htop' and 'httpd' (or 'postgresql-server') are no longer layered and cannot be used
# rpm-ostree status
State: idle
AutomaticUpdates: disabled
Deployments:
* ostree://fedora-iot:fedora/devel/x86_64/iot
                   Version: 32.20200408.0 (2020-04-08T11:07:02Z)
                    Commit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0

  ostree://fedora-iot:fedora/devel/x86_64/iot
                   Version: 32.20200408.0 (2020-04-08T11:07:02Z)
                BaseCommit: 7130f8716204842f0959498b2e86ef06d6e2a7dc5be036c9c84a4f28e1bca990
              GPGSignature: Valid signature by 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
           LayeredPackages: httpd wget
# rpm -q htop 
package htop is not installed
# rpm -q httpd
package httpd is not installed
# htop --version
bash: htop: command not found
# systemctl status httpd
Unit httpd.service could not be found.

Expected Results

  1. Verify that all layering operations were successful