[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 6/8] osstest: introduce a script to set the hostflags for FreeBSD jobs



On Fri, Jun 23, 2017 at 04:10:47PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH v3 6/8] osstest: introduce a script to set 
> the hostflags for FreeBSD jobs"):
> > Due to the nature of the FreeBSD install media, which is
> > self-generated from the ts-freebsd-build script, the hostflags set to
> > FreeBSD jobs are related to the current version under test.
> > 
> > The following hostflags might need to be fetched from the runvars of a
> > previous build-$arch-freebsd job:
> 
> I think it is wrong to have a script set the normally baked-in runvar
> host_hostflags.

Note that host_hostflags is not set before this script runs.

> In fact, I don't know how this script can have worked for you.
> Currently many build jobs have the runvar "host_hostflags" including
> many flags including "arch-i386" say, which I assume your FreeBSD
> build jobs will have from make-flight too.  (It is forbidden, and
> prevented, for a ts-* script to use store_runvar to modify a runvar
> provided as part of the job definition.)

In this case host_hostflags is not part of the job definition.

> I think you should probably invent something like
>   runtime_IDENT_hostflags
> and teach ts-hosts-allocate-Executive about it.

What should I store in this runvar?

The problem here is that I need to set two host_hostflags properties:

freebsd-<version>
share-build-freebsd-<arch>-<hash>

arch is not a problem because it's available at job creation, but both
<version> and <hash> are more difficult to get, because they might
come from a previous flight, and get_runvar must be executed from a
job context, or else it fails. That's the reason I needed to set
host_hostflags from a ts script, so that I could use get_runvar.

> > +sub get_freebsd_image_hash() {
> > +    my $distpath =  $r{"freebsd_distpath"} ||
> > +                    get_stashed("path_freebsddist", $r{"freebsdbuildjob"});
> > +
> > +    return `sha256sum $distpath/install.img|head -c 16`;
> 
> This pattern again.  I commented on it before, but now that you are
> repeating it, it should become a helper function.

It's done :).

> > +store_runvar("host_hostflags", $r{"extra_hostflags"} .
> > +             ",share-build-freebsd-$arch-$hash,freebsd-$version");
> 
> "extra_hostflags" would be the host flags for the host ident extra.

Just so that this is clear to me. When creating the job the
host_hostflags variable should not be set (when calling
job_create_build), and ts-hosts-allocate-Executive should set the
host_hostflags itself?

I don't really see how that's much different from what I was doing
here, the only difference being that I was introducing a new script
instead of modifying ts-hosts-allocate-Executive.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.