Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packaging/rpm/microshift.spec
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,11 @@ usermod -a -G hugetlbfs openvswitch

%systemd_post microshift.service

# only for install, not on upgrades
if [ $1 -eq 1 ]; then
# if crio was already started, restart it so it will catch /etc/crio/crio.conf.d/10-microshift.conf
systemctl is-active --quiet crio && systemctl restart --quiet crio || true
fi
# Restart crio and microshift services if they are active, both on installs and upgrades
# - Crio should pick up potential configuration updates
# - MicroShift should refresh running containers, pick up potential manifest updates, etc.
systemctl is-active --quiet crio && systemctl restart --quiet crio || true
systemctl is-active --quiet microshift && systemctl restart --quiet microshift || true

%pre selinux
%selinux_relabel_pre -s %{selinuxtype}
Expand Down Expand Up @@ -649,6 +649,9 @@ fi
# Use Git command to generate the log and replace the VERSION string
# LANG=C git log --date="format:%a %b %d %Y" --pretty="tformat:* %cd %an <%ae> VERSION%n- %s%n" packaging/rpm/microshift.spec
%changelog
* Mon Nov 11 2024 Gregory Giguashvili <[email protected]> 4.18.0
- Restart crio and microshift services on RPM post-install

* Sun Nov 10 2024 Gregory Giguashvili <[email protected]> 4.18.0
- Add sample kickstart files to microshift-release-info RPM

Expand Down
36 changes: 33 additions & 3 deletions test/suites/rpm/install-and-upgrade-successful.robot
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Install Source Version
[Teardown] Clean Up Test

Upgrade From Previous Version
[Documentation] Install the previous version, then upgrade
[Documentation] Install the previous version, then upgrade the package
... also verifying that crio and microshift services were restarted
# Always install from system repo, because the scenario script
# is enabling all the repositories needed.
#
Expand All @@ -56,13 +57,26 @@ Upgrade From Previous Version
Install MicroShift RPM Packages From System Repo
... 4.${PREVIOUS_MINOR_VERSION}.*
... check_warnings=False

# Verify the package version is as expected
${version}= MicroShift Version
Should Be Equal As Integers ${version.minor} ${PREVIOUS_MINOR_VERSION}
# Start the service and wait until initialized
Start MicroShift
Wait For MicroShift
# Take active timestamps for services
${cts1}= Command Should Work systemctl show -p ActiveEnterTimestamp crio
${mts1}= Command Should Work systemctl show -p ActiveEnterTimestamp microshift
# Upgrade the package without explicitly restarting the service
Install MicroShift RPM Packages From Repo ${SOURCE_REPO_URL} ${TARGET_VERSION}
# Restart MicroShift
Wait For MicroShift
# Take active timestamps for services
${cts2}= Command Should Work systemctl show -p ActiveEnterTimestamp crio
${mts2}= Command Should Work systemctl show -p ActiveEnterTimestamp microshift
# Run the timestamp verification
Verify Service Active Timestamps
... ${cts1} ${mts1}
... ${cts2} ${mts2}
# Restart the host to verify a clean start
Reboot MicroShift Host
# Health of the system is implicitly checked by greenboot successful exit
Wait Until Greenboot Health Check Exited
Expand Down Expand Up @@ -115,3 +129,19 @@ Version Should Match
[Arguments] ${expected}
${version}= MicroShift Version
Should Be Equal As Strings ${version.gitVersion} ${expected}

Verify Service Active Timestamps
[Documentation] Verify the service timestamps are valid and different
[Arguments] ${cts1} ${mts1} ${cts2} ${mts2}
Should Not Be Empty ${cts1}
Should Not Be Empty ${mts1}
Should Not Be Empty ${cts2}
Should Not Be Empty ${mts2}
# Verify that timestamps exist (services were active)
Should Not Be Equal As Strings ${cts1} ActiveEnterTimestamp=
Should Not Be Equal As Strings ${mts1} ActiveEnterTimestamp=
Should Not Be Equal As Strings ${cts2} ActiveEnterTimestamp=
Should Not Be Equal As Strings ${mts2} ActiveEnterTimestamp=
# Verify that timestamps changed (services restarted)
Should Not Be Equal As Strings ${cts1} ${cts2}
Should Not Be Equal As Strings ${mts1} ${mts2}