Re: [systemd-devel] how to add test sysfs nodes, to sys.tar.xz?

2017-02-07 Thread Dan Streetman
On Sun, Feb 5, 2017 at 6:26 PM, Zbigniew Jędrzejewski-Szmek
 wrote:
> On Mon, Jan 30, 2017 at 05:40:40PM -0500, Dan Streetman wrote:
>> On Thu, Jan 26, 2017 at 9:36 AM, Zbigniew Jędrzejewski-Szmek
>>  wrote:
>> > Thanks for working on the tests.
>> >
>> > On Thu, Jan 26, 2017 at 09:21:41AM -0500, Dan Streetman wrote:
>> >> However, I'd like to also add tests for whitespace replacement using
>> >> actual device $attr{}, which I think means the test/sys.tar.xz file
>> >> needs to be updated to add device (maybe a NVMe device) nodes that
>> >> include whitespace in its model and/or serial strings - is that how
>> >> new test sysfs device nodes are added?  Updating the entire binary
>> >> seems like a big change just for a few device node files..
>> > It's only 162k. It's not perfect that we have to update it every time
>> > we add tests, but it's not too terrible.
>> >
>> > If you're feeling ambitious, you might want to convert that tarball to
>> > a script which generates the nodes. After all, it's just a bunch of
>> > directories, with symlinks and a few simple text files. Then this will
>> > be normal text file and git will be able to track changes to it. This
>> > would a much nicer solution in the long run.
>>
>> I crafted a script that does that, which isn't complex, although it
>> isn't simple either.  However, I'm wondering, why not just store the
>> files directly in git?  It would be simpler than either the tarball or
>> a script, and git can handle symlinks and binary files, unless there's
>> some shortcoming that I'm not seeing?
>
> In principle, this would work too. But git tools aren't too good when
> working with symlinks (e.g. git diff treats them as normal text files,
> and displays a stupid warning about a missing newline, etc). When
> scaled to the number of files in /sys, I think working with this
> approach would be rather unpleasant.
>
> Can you paste the script you have?

yep, opened pr 5250
https://github.com/systemd/systemd/pull/5250

>
> Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] how to add test sysfs nodes, to sys.tar.xz?

2017-02-05 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Jan 30, 2017 at 05:40:40PM -0500, Dan Streetman wrote:
> On Thu, Jan 26, 2017 at 9:36 AM, Zbigniew Jędrzejewski-Szmek
>  wrote:
> > Thanks for working on the tests.
> >
> > On Thu, Jan 26, 2017 at 09:21:41AM -0500, Dan Streetman wrote:
> >> However, I'd like to also add tests for whitespace replacement using
> >> actual device $attr{}, which I think means the test/sys.tar.xz file
> >> needs to be updated to add device (maybe a NVMe device) nodes that
> >> include whitespace in its model and/or serial strings - is that how
> >> new test sysfs device nodes are added?  Updating the entire binary
> >> seems like a big change just for a few device node files..
> > It's only 162k. It's not perfect that we have to update it every time
> > we add tests, but it's not too terrible.
> >
> > If you're feeling ambitious, you might want to convert that tarball to
> > a script which generates the nodes. After all, it's just a bunch of
> > directories, with symlinks and a few simple text files. Then this will
> > be normal text file and git will be able to track changes to it. This
> > would a much nicer solution in the long run.
> 
> I crafted a script that does that, which isn't complex, although it
> isn't simple either.  However, I'm wondering, why not just store the
> files directly in git?  It would be simpler than either the tarball or
> a script, and git can handle symlinks and binary files, unless there's
> some shortcoming that I'm not seeing?

In principle, this would work too. But git tools aren't too good when
working with symlinks (e.g. git diff treats them as normal text files,
and displays a stupid warning about a missing newline, etc). When
scaled to the number of files in /sys, I think working with this
approach would be rather unpleasant.

Can you paste the script you have?

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] how to add test sysfs nodes, to sys.tar.xz?

2017-01-30 Thread Dan Streetman
On Thu, Jan 26, 2017 at 9:36 AM, Zbigniew Jędrzejewski-Szmek
 wrote:
> Thanks for working on the tests.
>
> On Thu, Jan 26, 2017 at 09:21:41AM -0500, Dan Streetman wrote:
>> However, I'd like to also add tests for whitespace replacement using
>> actual device $attr{}, which I think means the test/sys.tar.xz file
>> needs to be updated to add device (maybe a NVMe device) nodes that
>> include whitespace in its model and/or serial strings - is that how
>> new test sysfs device nodes are added?  Updating the entire binary
>> seems like a big change just for a few device node files..
> It's only 162k. It's not perfect that we have to update it every time
> we add tests, but it's not too terrible.
>
> If you're feeling ambitious, you might want to convert that tarball to
> a script which generates the nodes. After all, it's just a bunch of
> directories, with symlinks and a few simple text files. Then this will
> be normal text file and git will be able to track changes to it. This
> would a much nicer solution in the long run.

I crafted a script that does that, which isn't complex, although it
isn't simple either.  However, I'm wondering, why not just store the
files directly in git?  It would be simpler than either the tarball or
a script, and git can handle symlinks and binary files, unless there's
some shortcoming that I'm not seeing?

>
> Z.
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] how to add test sysfs nodes, to sys.tar.xz?

2017-01-26 Thread Zbigniew Jędrzejewski-Szmek
Thanks for working on the tests.

On Thu, Jan 26, 2017 at 09:21:41AM -0500, Dan Streetman wrote:
> However, I'd like to also add tests for whitespace replacement using
> actual device $attr{}, which I think means the test/sys.tar.xz file
> needs to be updated to add device (maybe a NVMe device) nodes that
> include whitespace in its model and/or serial strings - is that how
> new test sysfs device nodes are added?  Updating the entire binary
> seems like a big change just for a few device node files..
It's only 162k. It's not perfect that we have to update it every time
we add tests, but it's not too terrible.

If you're feeling ambitious, you might want to convert that tarball to
a script which generates the nodes. After all, it's just a bunch of
directories, with symlinks and a few simple text files. Then this will
be normal text file and git will be able to track changes to it. This
would a much nicer solution in the long run.

Z.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel