openSUSE Project Management Tool: Issueshttps://progress.opensuse.org/https://progress.opensuse.org/themes/openSUSE/favicon/favicon.ico?15829177842021-10-25T13:29:26ZopenSUSE Project Management Tool
Redmine openQA Project - action #101457 (New): Native per-module bug tagshttps://progress.opensuse.org/issues/1014572021-10-25T13:29:26Zrpalethorperichard.palethorpe@suse.com
<a name="Motivation"></a>
<h1 >Motivation<a href="#Motivation" class="wiki-anchor">¶</a></h1>
<p>We need to tag individual modules (e.g. LTP tests) within a job. Presently we (kernel qa) do this within job comments using syntax like "test123: bug#123". This requires parsing job comments.</p>
<p>Other teams have different solutions, like parsing external YAML files and marking individual modules as soft-failed.</p>
<p>Providing a single structured data source in OpenQA will simplify reporting and bug tag propagation.</p>
<a name="Goal"></a>
<h1 >Goal<a href="#Goal" class="wiki-anchor">¶</a></h1>
<p>Provide simple interface through OpenQA to:</p>
<ul>
<li>assign a bug to a job module</li>
<li>query the bug assigned to a job module</li>
<li>remove a bug from a job module</li>
</ul>
<p>I think a single reference to one bug tracker is sufficient. Related items in other trackers can be handled by one external tracker (e.g. Redmine).</p>
<a name="Non-Goals"></a>
<h1 >Non-Goals<a href="#Non-Goals" class="wiki-anchor">¶</a></h1>
<ul>
<li>Propagate bugs from one build to the next</li>
<li>Notifications or reporting</li>
</ul>
<a name="Alternatives"></a>
<h1 >Alternatives<a href="#Alternatives" class="wiki-anchor">¶</a></h1>
<ul>
<li>External service and database (e.g <a href="https://gitlab.suse.de/kernel-qa/bugtags" class="external">https://gitlab.suse.de/kernel-qa/bugtags</a>)</li>
</ul>
openQA Project - action #55751 (Resolved): Formatting for <br> and <code> tags in job description...https://progress.opensuse.org/issues/557512019-08-20T08:14:55Zrpalethorperichard.palethorpe@suse.com
<p>Previously we could write to force a line break in comments. Also we could use tags.</p>
<p>It seems these are now ignored or filtered. See:<br>
<a href="https://openqa.suse.de/group_overview/155" class="external">https://openqa.suse.de/group_overview/155</a></p>
<p>and <a href="https://openqa.suse.de/tests/3262174#comment-195942" class="external">https://openqa.suse.de/tests/3262174#comment-195942</a></p>
<p><em>hint</em> Look at the raw text</p>
<p>For job group descriptions we can switch to using Markdown style code sections if that works. However we need the tags for comments because they are submitted as a single line of text to the openqa cli. Of course someone could fix the cli and newline handling in comments.</p>
openQA Project - action #53891 (Resolved): [openqa] Posting comments results in getting comments ...https://progress.opensuse.org/issues/538912019-07-05T09:22:17Zrpalethorperichard.palethorpe@suse.com
<p>Take the following:</p>
<p>rich@rpws ~> openqa-client --host openqa.opensuse.org --apikey CB3705D3354546E0 --apisecret XXX jobs/975114/comments POST text=test123<br>
[<br>
{<br>
bugrefs => [],<br>
created => "2019-07-05 08:15:47 +0000",<br>
id => 43271,<br>
renderedMarkdown => "update comment test\n",<br>
text => "update comment test",<br>
updated => "2019-07-05 08:45:11 +0000",<br>
userName => "rpalethorpe",<br>
},<br>
]<br>
rich@rpws ~> openqa-client --host <a href="https://openqa.opensuse.org" class="external">https://openqa.opensuse.org</a> --apikey CB3705D3354546E0 --apisecret XXX jobs/975114/comments POST text=test123<br>
{ id => 43287 }</p>
<p>okurz thinks this may be due to <a href="https://github.com/os-autoinst/openQA/pull/2110" class="external">https://github.com/os-autoinst/openQA/pull/2110</a>.</p>
<p>Note that this only happens on O3 and not OSD. I also tried using two different versions of the openqa-client. Also the following works:</p>
<p>openqa-client --host openqa.opensuse.org --apikey CB3705D3354546E0 --apisecret XXX jobs/975114/comments/43271 PUT text="update comment test"<br>
{ id => 43271 }</p>
<p>So the problem maybe only effects POST requests.</p>
openQA Project - action #48182 (Resolved): [openqa] Disable bug carry over for a job grouphttps://progress.opensuse.org/issues/481822019-02-21T09:39:53Zrpalethorperichard.palethorpe@suse.com
<p>Because we have an <a href="https://gitlab.suse.de/rpalethorpe/jdp/blob/master/notebooks/Propagate%20Bug%20Tags.ipynb" class="external">external script</a> for propagating bug tags, we need to remove OpenQA's carry over comments.</p>
<p>In fact OpenQA's carry over comments are almost always wrong for the Kernel group anyway. They have also begun dropping the message stating they are a carry over comment. This makes deleting them more challenging. For example I did not post the following comment <a href="https://openqa.suse.de/tests/2481835#comment-165567" class="external">https://openqa.suse.de/tests/2481835#comment-165567</a> and neither did my script (you can see the bug summary is stale).</p>
<p>Alternatively to disabling the comments, we could parse any existing comments and check if they are doing something suspicious, like tagging a passing test. Then delete/modify those comments, however this could result in legitimate comments being deleted (or modified) in corner cases. The user should be able to override the script so I don't think this is a good idea.</p>
<p>AFAICT it is not currently possible to disable bug carry over for a given job group.</p>
openQA Project - action #40538 (Workable): Reset/Clear guest RAM when it reboots in QEMU to reduc...https://progress.opensuse.org/issues/405382018-09-03T14:22:40Zrpalethorperichard.palethorpe@suse.com
<p>During installation 4GB+ of RAM can be used by the guest. Most of the time the RAM usage is much lower than this.</p>
<p>After installation completes the system is rebooted and then a snapshot is taken. In theory the snapshot should be very small because the system has only just booted, however it appears that QEMU thinks all the RAM is still in use and saves it to the snapshot. This might not be unexpected because on bare metal the RAM is preserved between reboots on modern systems. However, assuming that it is not relied upon by the guest OS, we don't need it to happen and can save some time.</p>
<p>Some ideas to solve this:</p>
<ul>
<li>Use the virtio memory balloon</li>
<li>Use the -no-reboot switch and restart the QEMU process if it exits unexpectedly.</li>
<li>Patch QEMU to clear (some of) the RAM when the guest initiates a reboot.</li>
</ul>
openQA Project - action #40520 (New): SKIPTO fails to load snapshotshttps://progress.opensuse.org/issues/405202018-09-03T10:41:57Zrpalethorperichard.palethorpe@suse.com
<p>There appear to be multiple problems with this feature. In particular when using MAKETESTSNAPSHOTS.</p>
<p>Sometimes loading snapshots works as expected, but others it fails with various different error messages. Some of them from QEMU directly and others from the QEMU backend.</p>
<p>One error from the backend is:<br>
DIE Sequence mismatch while loading 'shutdown-shutdown' snapshot state: 30 != 28 at /home/geekotest/os-autoinst/OpenQA/Qemu/SnapshotConf.pm line 102.</p>
<p>Another from QEMU is:<br>
[2018-09-03T10:33:04.0775 CEST] [debug] QEMU: qemu-system-aarch64: Unknown savevm section or instance '0000:00:06.0/virtio-scsi' 0<br>
[2018-09-03T10:33:04.0775 CEST] [debug] QEMU: qemu-system-aarch64: load of migration failed: Invalid argument</p>
<p>Restarting the same job multiple times with SKIPTO seems to increase the chances of a failure.</p>
openQA Project - action #38822 (Resolved): Qemu: Could not open backing file: Cannot reference an...https://progress.opensuse.org/issues/388222018-07-25T09:41:54Zrpalethorperichard.palethorpe@suse.com
<p>When trying to revert to a snapshot QEMU dies with the following error or something similar:</p>
<pre><code>-blockdev driver=qcow2,node-name=hd0-overlay1,file=hd0-overlay1-file,cache.no-flush=on,backing=hd0: Could not open backing file: Cannot reference an existing block device with additional options or a new filename
</code></pre>
<p>The backing file is the hd0 block device which is specified on the command line. Possibly we should not specify block devices used as backing files on the command line and just allow them to be read from the overlay file. It is not clear what the expected usage is.</p>
openQA Project - action #36460 (Resolved): [kernel][tools] QEMU Refactor - Performance settingshttps://progress.opensuse.org/issues/364602018-05-23T14:02:30Zrpalethorperichard.palethorpe@suse.com
<p>Decide on cache mode and 'discard'.</p>
openQA Project - action #35815 (Resolved): [kernel][tools] Refactor QEMU backend - Fix VNC instal...https://progress.opensuse.org/issues/358152018-05-03T10:32:31Zrpalethorperichard.palethorpe@suse.com
<p>It appears that switching to the installation text console is broken with the new version (install-shell) in the logpackages test. Nothing happens when select console is called, it just stays in the graphical shell. However switching to the 'root-console' does work.</p>
openQA Project - action #35443 (Resolved): [kernel][tools] QEMU Refactor - Acceptance testinghttps://progress.opensuse.org/issues/354432018-04-24T16:06:49Zrpalethorperichard.palethorpe@suse.com
<p>Test on all architectures and backends. Test with interactive mode.</p>
openQA Project - action #35440 (Resolved): [kernel][tools] QEMU Refactor - Code format and rebasehttps://progress.opensuse.org/issues/354402018-04-24T16:02:55Zrpalethorperichard.palethorpe@suse.com
<p>Rebase onto master branch, use perl format and rebase the commit log.</p>
openQA Project - action #35437 (Resolved): [kernel][tools] QEMU Refactor - Publish diskhttps://progress.opensuse.org/issues/354372018-04-24T16:00:01Zrpalethorperichard.palethorpe@suse.com
<p>Write the overlays into a copy of the base block device image and publish it (do_extract_assets).</p>
openQA Project - action #35434 (Resolved): [kernel][tools] QEMU Refactor - Ensure consistent use ...https://progress.opensuse.org/issues/354342018-04-24T15:54:46Zrpalethorperichard.palethorpe@suse.com
<p>Replace verbose for loops and similar with standard library functions. Also just try to reduce verbosity in general.</p>
openQA Project - action #35431 (Resolved): [kernel][tools] QEMU Refactor - Clean up miscellaneous...https://progress.opensuse.org/issues/354312018-04-24T15:49:25Zrpalethorperichard.palethorpe@suse.com
<p>Decide whether to delete apparently unused features and workarounds or reimplement them (e.g. LVM, autoinst.img/FDD, HDDFORMAT).</p>
openQA Project - coordination #14626 (New): [epic] backend and console capabilities interface to ...https://progress.opensuse.org/issues/146262016-11-03T13:28:48Zrpalethorperichard.palethorpe@suse.com
<a name="Motivation"></a>
<h2 >Motivation<a href="#Motivation" class="wiki-anchor">¶</a></h2>
<p>Prevent "if/else" in tests needing to distinguish different backends</p>
<a name="Acceptance-criteria"></a>
<h2 >Acceptance criteria<a href="#Acceptance-criteria" class="wiki-anchor">¶</a></h2>
<ul>
<li><strong>AC1:</strong> No obvious "if/else" for different types of consoles in os-autoinst-distri-opensuse are necessary anymore</li>
<li><strong>AC2:</strong> Same as <em>AC1</em> for different <em>backends</em></li>
</ul>
<a name="Suggestions"></a>
<h2 >Suggestions<a href="#Suggestions" class="wiki-anchor">¶</a></h2>
<ul>
<li>Read what had been done in <a href="https://github.com/os-autoinst/os-autoinst/pull/1232">https://github.com/os-autoinst/os-autoinst/pull/1232</a> and <a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/8718">https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/8718</a> to define "persistent" consoles</li>
<li>Incorporate content from <a href="https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/Utils/Backends.pm">https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/lib/Utils/Backends.pm</a> into os-autoinst as flags on backends rather than if/else in test code</li>
<li>Look for other "if/else" code in test distributions, e.g. os-autoinst-distri-opensuse", distinguishing different backends and consoles to provide as capabilities on backends/consoles</li>
</ul>
<a name="Further-details"></a>
<h2 >Further details<a href="#Further-details" class="wiki-anchor">¶</a></h2>
<a name="Background"></a>
<h3 >Background<a href="#Background" class="wiki-anchor">¶</a></h3>
<p>In an ideal world all the backends (QEMU, bare metal, Xen) and consoles (VNC, serial or hybrid) would be accessed in a uniform manner by testapi so that the distribution and test writers could write their test case once and then have it run across all available platforms without modification. In practice however different Operating systems, hardware, hypervisors and console combinations differ significantly enough in behaviour that a completely uniform API is not possible without either significantly disadvantaging some platforms or providing support for edge cases in the distribution itself.</p>
<p>While the functions in testapi can be kept mostly uniform in availability and behaviour it requires that the distribution handles changes in the Operating System's behaviour due to the machine (virtual or physical) which it is running on and what user interface (console) is selected. Many things can be abstracted away into the console or backend classes in os-autoinst, however OS specific behaviour can not be without making os-autoinst specific to one type of OS or even Linux distribution. Currently the SUSE os-autoinst distribution handles differences between backends by reading variables to determine which backend or architecture is being used in a variety of different places and performing some particular action for that backend. Unfortunately this doesn't just happen in (suse)distribution.pm or other modules in the lib folder, but throughout the test cases.</p>
<p>The problem with branching on a particular architecture or backend is that the contents of the branch statement may actually apply to a whole class of backends not just one. Thus by restricting it to one particular backend you have missed an opportunity to maximise the benefit of your code, which will lead to duplication of effort. However in some cases it may be wasted effort to try inventing general abstractions when they will only be used in one or two instances, but then that is a universal problem, we just have to make a judgement on each and every case.</p>
<a name="Proposal"></a>
<h3 >Proposal<a href="#Proposal" class="wiki-anchor">¶</a></h3>
<p>At any rate my proposal is to introduce the notion of capabilities which can apply to consoles or backends. Any console or backend should have to declare its capabilities in a standard way which can then be read by the distribution and in some very rare cases, the distribution's test modules. Capabilities should be validated against a central list in the appropriate base class, attempting to access or set a capability which does not exist should be an error. This should make them better structured than simply adding more global variables which already serve this purpose to some extent. A list of quirks could also be maintained to indicate negative platform attributes.</p>
<p>The actual implementation could be done using a Perl map, object mixins from some Perl OO library or something else.</p>
<a name="Further-rambling"></a>
<h3 >Further rambling<a href="#Further-rambling" class="wiki-anchor">¶</a></h3>
<p>In the case of the serial terminal feature, I would remove the new testapi function I have added called is_serial_terminal and instead replace it with one or more console/backend capabilities. Perhaps something like <code>direct_read_text</code> and <code>direct_write_text</code> which indicates to the distribution that we are reading and writing raw text to the terminal, the backend would of course require a serial port capability to activate the console. The Linux VNC text console would have something like <code>redirect_write_text</code> which indicates we can redirect output to the serial port and some other capabilities to indicate that we can use needles and send key presses. Any console on some other OS/hardware combo which doesn't support serial ports will be missing the capabilities which indicate we can do this so either <code>run_script</code> and <code>wait_serial</code> will return an error indicating the missing capability or the distribution will have to implement the testapi functions using some other capabilities or workarounds.</p>
<p>Along with having capabilities comes the idea of having interfaces to take advantage of them, so that a backend, console and distribution with compatible capabilities can be plugged together. Such interfaces and their associated capabilities can be invented and implemented on a rolling basis rather than attempting to do some massive overhaul of the code base. This may slow down feature development for some time, but will eventually speed it up and creates a basis for a backend/console plugin architecture. I am willing to implement this in so far that it is required for <a class="issue tracker-4 status-3 priority-5 priority-high3 closed" title="action: Add virtio serial console backend and API (Resolved)" href="https://progress.opensuse.org/issues/14582">#14582</a> and other platform specific features I think that the LTP, and other test suites I may work with, can take advantage of.</p>
<a name="Alternatives"></a>
<h3 >Alternatives<a href="#Alternatives" class="wiki-anchor">¶</a></h3>
<p>The alternatives are to forgo taking advantage of platform specific features or add the occasional function to the testapi like <code>is_serial_terminal</code> and use the existing vars mechanism. At least for what I am currently doing, the latter choice is acceptable to me, but it is not extensible beyond a point. There is also the console proxy feature which allows you to tightly couple your test module to a particular console implementation completely bypassing all layers of abstraction while at the same time obfuscating the code flow using Perl meta programming which should be avoided at least from tests perspective.</p>
<a name="Problems"></a>
<h3 >Problems<a href="#Problems" class="wiki-anchor">¶</a></h3>
<p>It is more difficult to identify and isolate a class of behaviour shared by multiple entities and create an abstraction to encapsulate it than just to write code for a specific case. Sometimes people may attempt to create capabilities when there is no significant advantage to doing so or they may be tempted not to when there clearly is an advantage. The feature will need documenting and require effort on the part of reviewers to learn it and enforce its use. It will probably increase the codebases complexity initially until it has been reasonably taken advantage of. There is the danger of an explosion in capabilities which makes it difficult to write a new distribution which covers multiple platforms without understanding a large number of them. Regressions may be introduced while moving backends and consoles over to this system.</p>