Re: Self-contained test setup and ports

On 23/09/13 13:47, Tobie Langel wrote:
> On Monday, September 23, 2013 at 1:37 PM, James Graham wrote:
>> Another issue that I don't know how to address automatically is
>> setting up the subdomains that are required by the testsuite. As
>> best as I can tell this requires manual editing of /etc/hosts or
>> the platform equivalent. As part of the environement creation
>> process I can check that the expected list of subdomains works, but
>> if anyone has a good way to automatically create them, I would
>> appreciate hearing about it.
>
> Would it be possible to default those to w3c-test.org subdomains for
> test authoring and rely on /etc/hosts editing only where necessary?

I guess that sounds possible, although it doesn't really help if you 
author a cross-domain test since you won't be able to edit the files there.

The way I am thinking of dealing with the unknown-ports situation is to 
provide the current settings as a module or dict or something in python 
and have a pipe that you can use to do textual replacements in static 
files. So if you have a file foo.html with content like

<script>
var port = %(http_port_2)s
[...]

and load the file as foo.html?pipe=config

It will end up as

<script>
var port = 43525
[...]


So of course that can apply to the [sub]domains as well.

Received on Monday, 23 September 2013 12:58:43 UTC