[sru] fix autopkgtest typo

Bug #2037873 reported by nikhil kshirsagar
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sosreport (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
New
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Lunar
Fix Released
Undecided
Unassigned
Mantic
Fix Released
Undecided
Unassigned

Bug Description

[IMPACT]

Fix an autopkgtest typo in the autopkgtests, in simple.sh,

# test using mask
test_mask () {
 <snip>
        # only tests first interface
        ip_addr=$(ip route show default | awk '/default/ {print $3}')
        if [ "$(grep -rI $ip_addr /tmp/sosreport_test/*)" ]; then
            add_failure "IP address not obfuscated in all places"
            echo "$(grep -rI $ip_addr /tmp/sosreport/_test/*)" <======= the "/" should be removed
        fi
        update_failures
    fi
    update_summary "$cmd"
}

[TEST PLAN]

Manually create a sos with an unobfuscated IP address matching output of

ip_addr=$(ip route show default | awk '/default/ {print $3}')

Check if its printed properly when the simple.sh reports the test failure due to the sosreport containing this ip address.

[WHERE PROBLEMS COULD OCCUR]

This is a very trivial typo correction and I cannot anticipate any problems due to this change.

[OTHER INFO]

see https://bugs.launchpad.net/ubuntu/+source/sosreport/+bug/2028327/comments/14

description: updated
Changed in sosreport (Ubuntu Mantic):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 4.5.6-0ubuntu2

---------------
sosreport (4.5.6-0ubuntu2) mantic; urgency=medium

  * d/tests/simple.sh:
    - Correct typo in test_mask to print ip address
      (LP: #2037873)

  * d/p/0002-obfuscate-netplan-ssid-password.patch:
    - Obfuscate SSID password in netplan/XX.yaml files
      (LP: #2037872)

 -- Nikhil Kshirsagar <email address hidden> Tue, 03 Oct 2023 05:43:23 +0000

Changed in sosreport (Ubuntu Mantic):
status: In Progress → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello nikhil, or anyone else affected,

Accepted sosreport into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/4.5.6-0ubuntu1~22.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in sosreport (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-jammy
Changed in sosreport (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello nikhil, or anyone else affected,

Accepted sosreport into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/4.5.6-0ubuntu1~20.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in sosreport (Ubuntu Lunar):
status: New → Fix Committed
tags: added: verification-needed-lunar
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello nikhil, or anyone else affected,

Accepted sosreport into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sosreport/4.5.6-0ubuntu1~23.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (sosreport/4.5.6-0ubuntu1~20.04.2)

All autopkgtests for the newly accepted sosreport (4.5.6-0ubuntu1~20.04.2) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

sosreport/4.5.6-0ubuntu1~20.04.2 (arm64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#sosreport

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
nikhil kshirsagar (nkshirsagar) wrote (last edit ):

The autopkgtest failure on focal only on arm64 seems to be a false positive.

573s ######### DONE WITH --mask #########
573s !!! TEST FAILED: IP address not obfuscated in all places !!!
573s /tmp/sosreport_test/sos_commands/logs/journalctl_--no-pager:Oct 06 14:23:25 host0 systemd-hostnamed[571]: Changed host name to 'host-10-43-136-14'
573s /tmp/sosreport_test/sos_commands/logs/journalctl_--no-pager:Oct 06 14:24:33 host0 systemd-hostnamed[454]: Changed host name to 'host-10-43-136-14'
573s /tmp/sosreport_test/sos_commands/logs/journalctl_--no-pager:Oct 06 14:26:47 host0 systemd-hostnamed[453]: Changed host name to 'host-10-43-136-14'
573s /tmp/sosreport_test/sos_commands/logs/journalctl_--no-pager_--boot_-1:Oct 06 14:24:33 host0 systemd-hostnamed[454]: Changed host name to 'host-10-43-136-14'
573s /tmp/sosreport_test/sos_commands/logs/journalctl_--no-pager_--boot:Oct 06 14:26:47 host0 systemd-hostnamed[453]: Changed host name to 'host-10-43-136-14'
573s /tmp/sosreport_test/var/log/syslog:Oct 6 14:23:25 adt-focal-arm64-sosreport-20231006-142159-juju-4d1272-prod-prop systemd-hostnamed[571]: Changed host name to 'host-10-43-136-14'
573s /tmp/sosreport_test/var/log/syslog:Oct 6 14:24:33 adt-focal-arm64-sosreport-20231006-142159-juju-4d1272-prod-prop systemd-hostnamed[454]: Changed host name to 'host-10-43-136-14'
573s /tmp/sosreport_test/var/log/syslog:Oct 6 14:26:47 adt-focal-arm64-sosreport-20231006-142159-juju-4d1272-prod-prop systemd-hostnamed[453]: Changed host name to 'host-10-43-136-14'

When systemd-hotnamed changes the hostname to one that has the ip address (though with dashes not dots) , i.e 'host-10-43-136-14', the grep returns true since it thinks it matches the ip address 10.43.136.14 because we don't escape the dots with backslash.

nikhil@nikhil-Lenovo-Legion-Y540-15IRH-PG0:~/Downloads/test$ cat testgrep
573s /tmp/sosreport_test/sos_commands/logs/journalctl_--no-pager:Oct 06 14:23:25 host0 systemd-hostnamed[571]: Changed host name to 'host-10-43-136-14'
nikhil@nikhil-Lenovo-Legion-Y540-15IRH-PG0:~/Downloads/test$ grep -rI "10.43.136.14" .
./testgrep:573s /tmp/sosreport_test/sos_commands/logs/journalctl_--no-pager:Oct 06 14:23:25 host0 systemd-hostnamed[571]: Changed host name to 'host-10-43-136-14'
nikhil@nikhil-Lenovo-Legion-Y540-15IRH-PG0:~/Downloads/test$ grep -rI "10\.43\.136\.14" .
nikhil@nikhil-Lenovo-Legion-Y540-15IRH-PG0:~/Downloads/test$

 I don't see this as a blocker for this SRU.

Revision history for this message
nikhil kshirsagar (nkshirsagar) wrote (last edit ):

I have tested this on jammy, focal and lunar by changing the debian test as follows, using a manually created sos tarball containing an unmasked ip address.

# test using mask
test_mask () {
    cmd="--mask"
    run_expecting_success "$cmd" extract
    if [ $? -eq 0 ]; then
     <SNIP>
        fi
        # only tests first interface
        ### sru test
        rm -rf /tmp/sosreport_test/*
        mv /tmp/sostar/sosreport-jammy1-2023-10-07-ruwxxgf/* /tmp/sosreport_test/ <--
        ip_addr=$(ip route show default | awk '/default/ {print $3}')
        if [ "$(grep -rI $ip_addr /tmp/sosreport_test/*)" ]; then
            add_failure "IP address not obfuscated in all places"
            echo "$(grep -rI $ip_addr /tmp/sosreport_test/*)" <-- we see this output
        fi

I got expected results.

### end stdout
### start extraction
### stop extraction
######### DONE WITH --mask #########
!!! TEST FAILED: IP address not obfuscated in all places !!!
/tmp/sosreport_test/etc/hosts:10.159.14.1
/tmp/sosreport_test/ip_route:default via 10.159.14.1 dev eth0 proto dhcp src 10.159.14.4 metric 100
/tmp/sosreport_test/ip_route:10.159.14.1 dev eth0 proto dhcp scope link src 10.159.14.4 metric 100

Additionally, the failing autopkgtest (which is not a blocker as updated above) on focal-arm64 shows the SRU fix working as expected, so I am marking the verification flags done.

tags: added: verification-done verification-done-focal verification-done-jammy verification-done-lunar
removed: verification-needed verification-needed-focal verification-needed-jammy verification-needed-lunar
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 4.5.6-0ubuntu1~20.04.2

---------------
sosreport (4.5.6-0ubuntu1~20.04.2) focal; urgency=medium

  * d/tests/simple.sh:
    - Correct typo in test_mask to print ip address
      (LP: #2037873)

  * d/p/0002-obfuscate-netplan-ssid-password.patch:
    - Obfuscate SSID password in netplan/XX.yaml files
      (LP: #2037872)

 -- Nikhil Kshirsagar <email address hidden> Wed, 04 Oct 2023 03:41:30 +0000

Changed in sosreport (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for sosreport has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 4.5.6-0ubuntu1~22.04.2

---------------
sosreport (4.5.6-0ubuntu1~22.04.2) jammy; urgency=medium

  * d/tests/simple.sh:
    - Correct typo in test_mask to print ip address
      (LP: #2037873)

  * d/p/0002-obfuscate-netplan-ssid-password.patch:
    - Obfuscate SSID password in netplan/XX.yaml files
      (LP: #2037872)

 -- Nikhil Kshirsagar <email address hidden> Wed, 04 Oct 2023 03:35:14 +0000

Changed in sosreport (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sosreport - 4.5.6-0ubuntu1~23.04.2

---------------
sosreport (4.5.6-0ubuntu1~23.04.2) lunar; urgency=medium

  * d/tests/simple.sh:
    - Correct typo in test_mask to print ip address
      (LP: #2037873)

  * d/p/0002-obfuscate-netplan-ssid-password.patch:
    - Obfuscate SSID password in netplan/XX.yaml files
      (LP: #2037872)

 -- Nikhil Kshirsagar <email address hidden> Wed, 04 Oct 2023 03:12:42 +0000

Changed in sosreport (Ubuntu Lunar):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.