From Fedora Project Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 78: Line 78:


Visit the '''[http://testdays.fedoraproject.org/events/191 results page]''' and click on the column title links to see the tests that need to be run: most column titles are links to a specific test case. Follow the instructions there, then enter your results by clicking the ''Enter result'' button for the test.
Visit the '''[http://testdays.fedoraproject.org/events/191 results page]''' and click on the column title links to see the tests that need to be run: most column titles are links to a specific test case. Follow the instructions there, then enter your results by clicking the ''Enter result'' button for the test.
== Test Cases ==
=== Test Case 1 ===
Install a basic IPA server with HSM
How to test:
==== Install the freeipa packages ====
  # dnf install freeipa-server freeipa-server-dns softhsm -y
==== Rename the hostname with the domain to be used with ipa ====
  # hostnamectl hostname ipa.example.test
  # echo “<ip-address> ipa.example.test ” >> /etc/hosts
==== Create softhsm token ====
  # runuser -u pkiuser -- /usr/bin/softhsm2-util --init-token --free --pin $TOKEN_PASSWORD --so-pin $TOKEN_PASSWORD --label ipa_token
==== Install the IPA server ====
  # ipa-server-install -a $ADMIN_PASSWORD -p $DM_PASSWORD -r EXAMPLE.TEST -U --random-serial-numbers --token-name=ipa_token --token-library-path=/usr/lib64/pkcs11/libsofthsm2.so --token-password=$TOKEN_PASSWORD
==== Ensure that certificate stored with the hsm token ====
  # certutil -L -d /etc/pki/pki-tomcat/alias -h ipa_token
  ipa_token:ocspSigningCert cert-pki-ca                    u,u,u
  ipa_token:subsystemCert cert-pki-ca                      u,u,u
  ipa_token:auditSigningCert cert-pki-ca                  u,u,Pu
  ipa_token:caSigningCert cert-pki-ca                      CTu,Cu,Cu
==== Basic IPA Sanity ====
Test that basic things within IPA work.
  # kinit admin
  # ipa user-add --first tim --last user --password tuser
  # id tuser
  # kinit tuser (and reset password)
  # ipa user-show tuser
=== Test Case 2 ===
Install an IPA server and replica with HSM
How to test:
Install the freeipa packages on both machines
  # dnf install freeipa-server freeipa-server-dns softhsm -y
Rename the hostname with the domain to be used with ipa
server:
  # hostnamectl hostname ipa.example.test
  # echo “<ip-address> ipa.example.test ” >> /etc/hosts
==== Create softhsm token on ipa.example.test only ====
  # runuser -u pkiuser -- /usr/bin/softhsm2-util --init-token --free --pin $TOKEN_PASSWORD --so-pin $TOKEN_PASSWORD --label ipa_token
==== Install the IPA server ====
  # ipa-server-install -a $ADMIN_PASSWORD -p $DM_PASSWORD -r EXAMPLE.TEST -U --random-serial-numbers --token-name=ipa_token --token-library-path=/usr/lib64/pkcs11/libsofthsm2.so --token-password=$TOKEN_PASSWORD
==== Identify the token directory on ipa.example.test ====
  # ls -1tr /var/lib/softhsm/tokens/ | tail -1
This will return a UUID like e373ded4-8763-29e9-dff9-e41f6930297e
==== Copy token data to replica ====
  # export token=”<UUID>”
  # rsync -avp $IPA_SERVER_IP:/var/lib/softhsm/tokens/${token} /var/lib/softhsm/tokens/
==== Add a DNS server to ipa.example.test (it will make things easier) ====
  # ipa-dns-install --no-forwarders --auto-reverse
==== Add the replica IP information to DNS (on the IPA server) ====
  # kinit admin
  # ipa dnsrecord-add example.test. replica --a-rec=$REPLICA_IP
==== Set replica hostname ====
  # hostnamectl hostname replica.example.test
==== Configure the replica to use the IPA server DNS ====
  # resolvectl dns eth0 $IPA_SERVER_IP:53
==== Install ipa-replica ====
  # ipa-replica-install --domain example.test --realm EXAMPLE.TEST --admin-password $ADMIN_PASSWORD -U -N --setup-ca --token-password $TOKEN_PASSWORD
==== Verify that the certificate serial numbers are the same. Run this on both machines. ====
  # certutil -L -d /etc/pki/pki-tomcat/alias -h ipa_token -n 'ipa_token:subsystemCert cert-pki-ca' |grep -A1 'Serial Number:'
        Serial Number: 4 (0x4)
=== Test Case 3 ===
Install an IPA server with a KRA
How to test:
==== Install the freeipa packages ====
  # dnf install freeipa-server freeipa-server-dns softhsm -y
==== Rename the hostname with the domain to be used with ipa ====
  # hostnamectl hostname ipa.example.test
  # echo “<ip-address> ipa.example.test” >> /etc/hosts
==== Create softhsm token ====
  # runuser -u pkiuser -- /usr/bin/softhsm2-util --init-token --free --pin $TOKEN_PASSWORD --so-pin $TOKEN_PASSWORD --label ipa_token
==== Install the IPA server ====
  # ipa-server-install -a $ADMIN_PASSWORD -p $DM_PASSWORD -r EXAMPLE.TEST -U --random-serial-numbers --token-name=ipa_token --token-library-path=/usr/lib64/pkcs11/libsofthsm2.so --token-password=$TOKEN_PASSWORD --setup-kra
==== Ensure that certificate stored with the hsm token (note the kra certs) ====
  # certutil -L -d /etc/pki/pki-tomcat/alias -h ipa_token
==== Verify that the KRA is functional ====
  # kinit admin
  # ipa vault-add test
  # ipa vault-archive test --data Zm9vCg==
  # ipa vault-retrieve test
=== Test Case 4 ===
Install an IPA server and replica with KRA
How to test:
==== Install the freeipa packages ====
  # dnf install freeipa-server freeipa-server-dns softhsm -y
==== Rename the hostname with the domain to be used with ipa ====
  # hostnamectl hostname ipa.example.test
  # echo “<ip-address> ipa.example.test” >> /etc/hosts
==== Create softhsm token ====
  # runuser -u pkiuser -- /usr/bin/softhsm2-util --init-token --free --pin $TOKEN_PASSWORD --so-pin $TOKEN_PASSWORD --label ipa_token
==== Install IPA server with a KRA ====
  # ipa-server-install -a $ADMIN_PASSWORD -p $DM_PASSWORD -r EXAMPLE.TEST -U --random-serial-numbers --token-name=ipa_token --token-library-path=/usr/lib64/pkcs11/libsofthsm2.so --token-password=$TOKEN_PASSWORD --setup-kra
==== Identify the token directory on ipa.example.test ====
  # ls -1tr /var/lib/softhsm/tokens/ | tail -1
This will return a UUID like e373ded4-8763-29e9-dff9-e41f6930297e
==== Copy token data to replica ====
  # export token=”<UUID>”
  # rsync -avp $IPA_SERVER_IP:/var/lib/softhsm/tokens/${token} /var/lib/softhsm/tokens/
==== Add a DNS server to ipa.example.test (it will make things easier) ====
  # ipa-dns-install --no-forwarders --auto-reverse
==== Add the replica IP information to DNS (on the IPA server) ====
  # kinit admin
  # ipa dnsrecord-add example.test. replica --a-rec=$REPLICA_IP
==== Set replica hostname ====
  # hostnamectl hostname replica.example.test
==== Configure the replica to use the IPA server DNS ====
  # resolvectl dns eth0 $IPA_SERVER_IP:53
==== Install an IPA replica with a KRA ====
  # ipa-replica-install --domain example.test --realm EXAMPLE.TEST --admin-password $ADMIN_PASSWORD -U -N --setup-ca --token-password $TOKEN_PASSWORD --setup-kra
==== Verify that the KRA is functional ====
This vault can be created on either machine. Please verify that the vault is accessible on both.
  # kinit admin
  # ipa vault-add test
  # ipa vault-archive test --data Zm9vCg==
  # ipa vault-retrieve test
=== Test Case 5 ===
Install an IPA server with HSM and renew a certificate outside the grace period
How to test:
==== Install the freeipa packages ====
  # dnf install freeipa-server freeipa-server-dns softhsm -y
==== Rename the hostname with the domain to be used with ipa ====
  # hostnamectl hostname ipa.example.test
  # echo “<ip-address> ipa.example.test” >> /etc/hosts
==== Create softhsm token ====
  # runuser -u pkiuser -- /usr/bin/softhsm2-util --init-token --free --pin $TOKEN_PASSWORD --so-pin $TOKEN_PASSWORD --label ipa_token
==== Install the IPA server ====
  # ipa-server-install -a $ADMIN_PASSWORD -p $DM_PASSWORD -r EXAMPLE.TEST -U --random-serial-numbers --token-name=ipa_token --token-library-path=/usr/lib64/pkcs11/libsofthsm2.so --token-password=$TOKEN_PASSWORD
==== Move date to within the expiration grace period ====
  # date -s +2years+11months+20days
  # ipactl restart
  # sleep 90
==== Force issuance of new certs ====
  # ipa-cert-fix (answer yes)
It will take a bit for new certs to be issued and for certmonger to notice. To monitor it:
watch -n 5 'getcert list | grep status'
==== Expected results ====
The expired certificates (all but the CA cert) will be re-issued. As you monitor using getcert list you may see the certificates go through different states including:
SUBMITTING, GENERATING_CSR,  POST_SAVED_CERT, NEED_TO_SUBMIT and/or NEED_TO_SAVE_CERT
==== Return date to current time ====
Uninstall the IPA server prior to moving time backwards.
# date +s +2years+11months+20days
=== Test Case 6 ===
Install an IPA server with HSM and renew a certificate inside the grace period
How to test:
==== Install the freeipa packages ====
  # dnf install freeipa-server freeipa-server-dns softhsm -y
==== Rename the hostname with the domain to be used with ipa ====
  # hostnamectl hostname ipa.example.test
  # echo “<ip-address> ipa.example.test” >> /etc/hosts
==== Create softhsm token ====
  # runuser -u pkiuser -- /usr/bin/softhsm2-util --init-token --free --pin $TOKEN_PASSWORD --so-pin $TOKEN_PASSWORD --label ipa_token
==== Install the IPA server ====
  # ipa-server-install -a $ADMIN_PASSWORD -p $DM_PASSWORD -r EXAMPLE.TEST -U --random-serial-numbers --token-name=ipa_token --token-library-path=/usr/lib64/pkcs11/libsofthsm2.so --token-password=$TOKEN_PASSWORD
==== Move date to near the end of the grace period ====
  # date -s +1years+11months+20days
==== Monitor the renewal ====
It will take a bit for new certs to be issued and for certmonger to notice. To monitor it:
  # watch -n 5 'getcert list | grep status'
The expired certificates (all but the CA cert) will be re-issued. As you monitor using getcert list you may see the certificates go through different states including:
SUBMITTING, GENERATING_CSR,  POST_SAVED_CERT, NEED_TO_SUBMIT and/or NEED_TO_SAVE_CERT
If one certificate fails to renew with CA_UNREACHABLE wait until all of the certs are either in this state or MONITORING. Then restart certmonger and run the watch again. Certificate renewal can be bumpy as lots of service restarts happen and the renewals can step on one another.


== Reporting bugs ==
== Reporting bugs ==
Line 106: Line 383:
== Test Results ==
== Test Results ==


Visit the '''[http://testdays.fedoraproject.org/events/191 results page]''' and click on the column title links to see the tests that need to be run: most column titles are links to a specific test case. Follow the instructions there, then enter your results by clicking the ''Enter result'' button for the test.
Test results will be exported here once the test day is over. See [[#How_to_test?|How to test?]] section for information how to submit results and see the live results.
Test results will be exported here once the test day is over. See [[#How_to_test?|How to test?]] section for information how to submit results and see the live results.


Please note that all contributions to Fedora Project Wiki are considered to be released under the Attribution-Share Alike 4.0 International (see Fedora Project Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please solve the following task below and enter the answer in the box (more info):

Cancel Editing help (opens in new window)