Skip to main content

[pkg-discuss] Re: [review] file overlay fixes

  • From: Shawn Walker < >
  • To: Tim Foster < >
  • Cc:
  • Subject: [pkg-discuss] Re: [review] file overlay fixes
  • Date: Tue, 11 Jun 2013 17:15:25 -0700

On 06/11/13 17:05, Tim Foster wrote:
On 06/11/13 09:20 PM, Tim Foster wrote:

I'm going to look at the tests in more detail tomorrow (my brain's a bit
fried, and I'd rather look at these when I'm fresh - sorry for the
further delay)

I've gone through those tests, and they look pretty thorough. The only
think I could think of that might be worth testing as well, is that when
we attempt to install an overlay where the preserve action has not
changed, that if the file/owner/group have changed, we do still reject
the overlay.

[ we test for those conflicts on basic overlays at line 7775, but I
wasn't sure whether these bugfixes have any impact on that functionality ]


7867    # Install overlaying package, then update overlaid package and
7868    # verify that file content does not change if only preserve
7869    # attribute changes.
7870    self.pkg("install -vvv unpreserved-overlayer")
7871    self.file_contains("etc/pam.conf", "unpreserved")
7872    self.pkg("install overlaid@1")
7873    self.file_contains("etc/pam.conf", "unpreserved")

# change permissions of tmp/file1
open overlaid@99,5.11-0
add dir path=etc mode=0755 owner=root group=root
add file tmp/file1 path=etc/pam.conf mode=755 owner=sys group=sys
preserve=renamenew overlay=allow

Then check that installing this package at line 7874 fails:

self.pkg("install overlaid@99", exit=1)

and similar, when changing the permissions of the overlaying package.

That really falls under the standard conflict checking mechanism found in

1286 if overlayable and overlay:
1287         # Found both an overlayable action and the
1288         # action that overlays it.
1289         errors = ImagePlan.__find_inconsistent_attrs(
1290             actions, ignore=["preserve"])
1291         if errors:
1292                 # overlay is not permitted if unique
1293                 # attributes (except 'preserve') are
1294                 # inconsistent
1295                 return ("error", actions,
1296                     api_errors.InconsistentActionAttributeError)
1297         return "overlay", None

Note the call to __find_inconsistent_attrs.

So are you asking for a test where if both the 'overlay=allow' action and the 'overlay=true' action change mode/owner/group but do not change content that the content remains unchanged? If so, that should be covered already under test_file_preserve lines 2626-2646 in

If you're concerned about the overlaying package having attributes that don't match what's being overlaid, that should be covered by lines 7775-7777 in

Not objecting, just want to be clear.


[pkg-discuss] Re: [review] file overlay fixes

Tim Foster 06/11/2013

[pkg-discuss] Re: [review] file overlay fixes

Shawn Walker 06/11/2013

[pkg-discuss] Re: [review] file overlay fixes

Tim Foster 06/12/2013

[pkg-discuss] Re: [review] file overlay fixes

Shawn Walker 06/12/2013

[pkg-discuss] Re: [review] file overlay fixes

Tim Foster 06/12/2013
Please Confirm