Merge ~fginther/qa-regression-testing:python2to3 into qa-regression-testing:master

Proposed by Francis Ginther
Status: Merged
Merged at revision: c9e0d17c7a56d3721e83076cf4b89ee96dc4365b
Proposed branch: ~fginther/qa-regression-testing:python2to3
Merge into: qa-regression-testing:master
Diff against target: 31 lines (+4/-4)
2 files modified
scripts/kernel-security/errno-read.py (+2/-2)
scripts/kernel-security/proc-maps/maps-protection.py (+2/-2)
Reviewer Review Type Date Requested Status
Steve Beattie Approve
Review via email: mp+440503@code.launchpad.net

Commit message

Apply python 2to3 conversion on errno-read.py and maps-protection.py

Convert these two scripts to execute with python3 now that python2 has
been removed from lunar.

Signed-off-by: Francis Ginther <email address hidden>

To post a comment you must log in.
Revision history for this message
Steve Beattie (sbeattie) wrote :

Hey Francis,

On Thu, Apr 06, 2023 at 01:30:18PM -0000, Francis Ginther wrote:
> Francis Ginther has proposed merging ~fginther/qa-regression-testing:python2to3 into qa-regression-testing:master.
>
> Commit message:
> Apply python 2to3 conversion on errno-read.py and maps-protection.py

I think this looks fine to me, but do the kernel test environments
in 14.04 ESM trusty get python3 installed in them? I forget which
release we started installing python3 by default.

Thanks!

--
Steve Beattie
<email address hidden>

Revision history for this message
Francis Ginther (fginther) wrote :

Steve,

Thanks for the review. I've checked that our kernel test environments do have python3 (3.4 is seeded into the cloud images [1]). I've also verified that the two tests that led to this change, test_010_proc_maps and test_032_dev_kmem, now pass on both lunar and trusty.

[1] - https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64.manifest

Revision history for this message
Steve Beattie (sbeattie) wrote :

Excellent, thanks, merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/kernel-security/errno-read.py b/scripts/kernel-security/errno-read.py
2index 8e31c38..8161f08 100755
3--- a/scripts/kernel-security/errno-read.py
4+++ b/scripts/kernel-security/errno-read.py
5@@ -1,5 +1,5 @@
6-#!/usr/bin/env python2
7-from __future__ import print_function
8+#!/usr/bin/env python3
9+
10 import sys
11 try:
12 f = open(sys.argv[1])
13diff --git a/scripts/kernel-security/proc-maps/maps-protection.py b/scripts/kernel-security/proc-maps/maps-protection.py
14index 6cbcf57..2df9882 100755
15--- a/scripts/kernel-security/proc-maps/maps-protection.py
16+++ b/scripts/kernel-security/proc-maps/maps-protection.py
17@@ -1,4 +1,4 @@
18-#!/usr/bin/env python2
19+#!/usr/bin/env python3
20 #
21 # This verifies that memory-segment listing /proc files (maps, smaps) are
22 # not world-readable, and that setuid priv-dropped process can still read
23@@ -9,7 +9,7 @@
24 # Copyright (C) 2008, 2013 Canonical, Ltd.
25 # Author: Kees Cook <kees@ubuntu.com>
26 # License: GPLv3
27-from __future__ import print_function
28+
29
30 import errno
31 import os

Subscribers

People subscribed via source and target branches