<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openembedded-core.git/meta/lib/oeqa/utils, branch master</title>
<subtitle>Mirror of openembedded-core</subtitle>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/'/>
<entry>
<title>oeqa/utils/targetbuild: tmp dir improvements</title>
<updated>2017-04-06T09:13:34+00:00</updated>
<author>
<name>Joshua Lock</name>
<email>joshua.g.lock@intel.com</email>
</author>
<published>2017-04-05T12:10:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=c43c966e0ed4ed836bdf90b1d4c3f2f45426f1ec'/>
<id>c43c966e0ed4ed836bdf90b1d4c3f2f45426f1ec</id>
<content type='text'>
Don't hard-code /tmp as the tmpdir, instead use WORKDIR as the tmpdir if the
instantiater doesn't specify a value.

Signed-off-by: Joshua Lock &lt;joshua.g.lock@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't hard-code /tmp as the tmpdir, instead use WORKDIR as the tmpdir if the
instantiater doesn't specify a value.

Signed-off-by: Joshua Lock &lt;joshua.g.lock@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oeqa/utils/buildproject: create a more unique tmp dir</title>
<updated>2017-04-06T09:13:34+00:00</updated>
<author>
<name>Joshua Lock</name>
<email>joshua.g.lock@intel.com</email>
</author>
<published>2017-04-05T12:10:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=9425c2658fea0b45468a04574cd77bffc6668a8d'/>
<id>9425c2658fea0b45468a04574cd77bffc6668a8d</id>
<content type='text'>
Rather than hardcoding /tmp as the default tmpdir make a more unique tmpdir
with tempfile.mkdtemp() when the caller doesn't specify a tmpdir value.

Signed-off-by: Joshua Lock &lt;joshua.g.lock@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than hardcoding /tmp as the default tmpdir make a more unique tmpdir
with tempfile.mkdtemp() when the caller doesn't specify a tmpdir value.

Signed-off-by: Joshua Lock &lt;joshua.g.lock@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>selftest/commands: extend variable regex to include A_B variable notation</title>
<updated>2017-04-05T08:43:40+00:00</updated>
<author>
<name>Leonardo Sandoval</name>
<email>leonardo.sandoval.gonzalez@linux.intel.com</email>
</author>
<published>2017-04-04T16:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=3810738eff6bdcf27c7e291dbeaedc699ab14bfc'/>
<id>3810738eff6bdcf27c7e291dbeaedc699ab14bfc</id>
<content type='text'>
This change allows quering for variables with the format A_B, i.e.
PREFERRED_PROVIDER_virtual/kernel instead of just A.

Signed-off-by: Leonardo Sandoval &lt;leonardo.sandoval.gonzalez@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change allows quering for variables with the format A_B, i.e.
PREFERRED_PROVIDER_virtual/kernel instead of just A.

Signed-off-by: Leonardo Sandoval &lt;leonardo.sandoval.gonzalez@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oeqa: allow persistent image writes in runqemu()</title>
<updated>2017-03-28T08:16:10+00:00</updated>
<author>
<name>Patrick Ohly</name>
<email>patrick.ohly@intel.com</email>
</author>
<published>2017-03-28T08:02:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=969d079a33a57f5a8f7af86d7bab04d35ab07584'/>
<id>969d079a33a57f5a8f7af86d7bab04d35ab07584</id>
<content type='text'>
By default, QemuRunner avoids modifying the image files that it boots
into by enabling the qemu snapshot mode. However, some tests may want
to test changes that must persists across reboots, so this mode
should be optional.

This can be combined by copying the image file to a temporary location
first and then booting with that copy. It's also useful when testing
with additional drives attached to a virtual machine.

QemuTinyRunner doesn't use the snapshot parameter and therefore ignores
the new parameter.

Long term, a better way of passing these various configuration
parameters should be used, and perhaps QemuRunner and QemuTinyRunner
can be merged into one again to avoid code duplication. But for now
the patch follows the exiting style.

Also beware that QemuTarget.start() now acts in two different modes
(with or without explicit launch command), and depending on that mode
parameters like discard_writes must be ignored, i.e. not get passed to
launch().

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default, QemuRunner avoids modifying the image files that it boots
into by enabling the qemu snapshot mode. However, some tests may want
to test changes that must persists across reboots, so this mode
should be optional.

This can be combined by copying the image file to a temporary location
first and then booting with that copy. It's also useful when testing
with additional drives attached to a virtual machine.

QemuTinyRunner doesn't use the snapshot parameter and therefore ignores
the new parameter.

Long term, a better way of passing these various configuration
parameters should be used, and perhaps QemuRunner and QemuTinyRunner
can be merged into one again to avoid code duplication. But for now
the patch follows the exiting style.

Also beware that QemuTarget.start() now acts in two different modes
(with or without explicit launch command), and depending on that mode
parameters like discard_writes must be ignored, i.e. not get passed to
launch().

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oeqa: allow customizing image used by runqemu()</title>
<updated>2017-03-28T08:16:10+00:00</updated>
<author>
<name>Patrick Ohly</name>
<email>patrick.ohly@intel.com</email>
</author>
<published>2017-03-28T08:02:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=4c6ba32abd6b9de33f4b8a0b87e8a56432ed7825'/>
<id>4c6ba32abd6b9de33f4b8a0b87e8a56432ed7825</id>
<content type='text'>
runqemu() takes all parameters for the virtual machine from the
variables of the given recipe. By allowing the caller to provide a
hash with variables that get applied locally, the caller gets more
control.

Here's the intended usage:

   &lt;prepare internal-image in self.resultdir&gt;
   overrides = {
        'DEPLOY_DIR_IMAGE': self.resultdir,
        'IMAGE_LINK_NAME': 'internal-image-%s' % self.image_arch,
   }
   with runqemu('refkit-installer-image', ssh=False,
                 overrides=overrides) as qemu:
       ....

This can be used to replace the image completely with something else
or to copy it before allowing runqemu() to write into it.

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
runqemu() takes all parameters for the virtual machine from the
variables of the given recipe. By allowing the caller to provide a
hash with variables that get applied locally, the caller gets more
control.

Here's the intended usage:

   &lt;prepare internal-image in self.resultdir&gt;
   overrides = {
        'DEPLOY_DIR_IMAGE': self.resultdir,
        'IMAGE_LINK_NAME': 'internal-image-%s' % self.image_arch,
   }
   with runqemu('refkit-installer-image', ssh=False,
                 overrides=overrides) as qemu:
       ....

This can be used to replace the image completely with something else
or to copy it before allowing runqemu() to write into it.

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oeqa: allow extending qemuparams="..."</title>
<updated>2017-03-28T08:16:10+00:00</updated>
<author>
<name>Patrick Ohly</name>
<email>patrick.ohly@intel.com</email>
</author>
<published>2017-03-28T08:02:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=b2a1cf09ea65ed6f561886b1b4241f9adf3e5709'/>
<id>b2a1cf09ea65ed6f561886b1b4241f9adf3e5709</id>
<content type='text'>
Sometimes it is useful to reconfigure the qemu virtual machine
directly. runqemu has the "qemuparams" parameter for that, and the
underlying start() methods also supported modifying that via their
"params" parameter. Only the runqemu() wrapper function lacked
a way to specify additional parameters.

One potential usage is to attach additional disks.

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometimes it is useful to reconfigure the qemu virtual machine
directly. runqemu has the "qemuparams" parameter for that, and the
underlying start() methods also supported modifying that via their
"params" parameter. Only the runqemu() wrapper function lacked
a way to specify additional parameters.

One potential usage is to attach additional disks.

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oeqa: tolerate interrupted select() while waiting for qemu</title>
<updated>2017-03-28T07:41:08+00:00</updated>
<author>
<name>Patrick Ohly</name>
<email>patrick.ohly@intel.com</email>
</author>
<published>2017-03-27T13:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=44fe106baf5fd5aebe26c5f28004e2b18d839b7c'/>
<id>44fe106baf5fd5aebe26c5f28004e2b18d839b7c</id>
<content type='text'>
Sometimes, the OEQA utility code aborts with:

   ...
   File ".../meta/lib/oeqa/utils/qemurunner.py", line 131, in start
     return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams)
   File ".../meta/lib/oeqa/utils/qemurunner.py", line 259, in launch
     sread, swrite, serror = select.select(socklist, [], [], 5)
  InterruptedError: [Errno 4] Interrupted system call

strace shows that this is because of a SIGWINCH:

   Connection from 127.0.0.1:52668
   select(21, [20], [], [], {5, 0})        = ? ERESTARTNOHAND (To be restarted if no handler)
   --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---

This is related to some special conditions:
 * whether qemu opens a graphical console window (enabled in Poky by default)
 * where that window gets opened
 * whether the window manager changes the size of the shell window (mine
   is a tiling window manager and reorders and resizes windows automatically)

Ignoring the interrupted system calls avoids the problem. Code elsewhere (for example,
run() in ssh.py) already does the same thing.

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometimes, the OEQA utility code aborts with:

   ...
   File ".../meta/lib/oeqa/utils/qemurunner.py", line 131, in start
     return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams)
   File ".../meta/lib/oeqa/utils/qemurunner.py", line 259, in launch
     sread, swrite, serror = select.select(socklist, [], [], 5)
  InterruptedError: [Errno 4] Interrupted system call

strace shows that this is because of a SIGWINCH:

   Connection from 127.0.0.1:52668
   select(21, [20], [], [], {5, 0})        = ? ERESTARTNOHAND (To be restarted if no handler)
   --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---

This is related to some special conditions:
 * whether qemu opens a graphical console window (enabled in Poky by default)
 * where that window gets opened
 * whether the window manager changes the size of the shell window (mine
   is a tiling window manager and reorders and resizes windows automatically)

Ignoring the interrupted system calls avoids the problem. Code elsewhere (for example,
run() in ssh.py) already does the same thing.

Signed-off-by: Patrick Ohly &lt;patrick.ohly@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oeqa.utils.commands: limit runCmd exception output</title>
<updated>2017-03-26T12:17:03+00:00</updated>
<author>
<name>Markus Lehtonen</name>
<email>markus.lehtonen@linux.intel.com</email>
</author>
<published>2017-03-24T14:43:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=403dd205828002d6ef4e8b474aedb6082289e22f'/>
<id>403dd205828002d6ef4e8b474aedb6082289e22f</id>
<content type='text'>
Make it possible to limit the length of output lines shown in runCmd
exceptions. E.g when running bitbake we easily get thousands of lines of
log output, where only the last few (tens) are interesting or relevant
when an error occurs.

Signed-off-by: Markus Lehtonen &lt;markus.lehtonen@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make it possible to limit the length of output lines shown in runCmd
exceptions. E.g when running bitbake we easily get thousands of lines of
log output, where only the last few (tens) are interesting or relevant
when an error occurs.

Signed-off-by: Markus Lehtonen &lt;markus.lehtonen@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qemurunner.py: fix handling of runqemuparams</title>
<updated>2017-03-26T12:17:01+00:00</updated>
<author>
<name>Chen Qi</name>
<email>Qi.Chen@windriver.com</email>
</author>
<published>2017-03-24T08:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=16400f2b8bffc4cae0263bb597522071299b46ca'/>
<id>16400f2b8bffc4cae0263bb597522071299b46ca</id>
<content type='text'>
The launch() doesn't need runqemuparams, we need handle it in start().

Signed-off-by: Chen Qi &lt;Qi.Chen@windriver.com&gt;
Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The launch() doesn't need runqemuparams, we need handle it in start().

Signed-off-by: Chen Qi &lt;Qi.Chen@windriver.com&gt;
Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>oeqa/targetcontrol.py: modify it to test runqemu</title>
<updated>2017-03-26T12:17:01+00:00</updated>
<author>
<name>Robert Yang</name>
<email>liezhi.yang@windriver.com</email>
</author>
<published>2017-03-24T08:44:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.multitech.net/cgit/openembedded-core.git/commit/?id=9305d816bdf8837ea3a407091cb7f24a9a3ae8dc'/>
<id>9305d816bdf8837ea3a407091cb7f24a9a3ae8dc</id>
<content type='text'>
Modify the following files to test runqemu:
    targetcontrol.py
    utils/commands.py
    utils/qemurunner.py

We need simulate how "runqemu" works in command line, so when test
"runqemu", the targetcontrol.py, utils/commands.py and
utils/qemurunner.py don't have to find the rootfs or set env vars.

[YOCTO #10249]

Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify the following files to test runqemu:
    targetcontrol.py
    utils/commands.py
    utils/qemurunner.py

We need simulate how "runqemu" works in command line, so when test
"runqemu", the targetcontrol.py, utils/commands.py and
utils/qemurunner.py don't have to find the rootfs or set env vars.

[YOCTO #10249]

Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
