<div dir="ltr"><div>You should have a look inside <i>plinth/modules/storage/tests/</i> directory.</div><div><i><br></i></div><div><i>storage.feature</i> is the behaviour description of the tests. It is written in an easy human-readable formal language called Gherkin. Currently it contains only one scenario (<code><span class="gmail-kn">Scenario</span><span class="gmail-p">:</span> List disks</code>).</div><div><i><br></i></div><div>'<code><span class="gmail-kn">Background</span><span class="gmail-p">'</span></code> marks the part that is common to all scenarios. But as I said, we currently have only one in this file.<i><code><span class="gmail-p"><br></span></code></i></div><div>The line '<code><span class="gmail-nf">Given </span>I'm a logged in user'</code> logs' the user in.</div><div><br></div><div>The line '<code><span class="gmail-nf">Given </span>I'm on the storage page'</code> calls the function in file <i>test_functional.py</i> marked with '<code><span class="gmail-o">@</span><span class="gmail-n">given</span><span class="gmail-p">(</span><span class="gmail-n">parsers</span><span class="gmail-p">.</span><span class="gmail-n">parse</span><span class="gmail-p">(</span><span class="gmail-s">"I'm on the {name:w} page"</span><span class="gmail-p">))'.</span></code><br>The line'<code><code><span class="gmail-nf">Then </span>the root disk should be shown</code>'</code>calls the function in file <i>test_functional.py</i> marked with '<code><span class="gmail-o"></span><span class="gmail-p"><code><span class="gmail-o">@</span><span class="gmail-n">then</span><span class="gmail-p">(</span><span class="gmail-s">'the root disk should be shown'</span><span class="gmail-p">)</span></code>'</span></code><code>.<br></code></div><div><br></div><div>This way, the functional behaviour (independent from the implementation) is defined in <i>*.features</i> files. And then other <i>*.py</i> files resolve the underlying implementation.<br></div><div><br></div><div>Now we need to fix the test by making it check first if it is running inside a container (with <code>systemd-detect-virt --container</code>) and if that's the case, it should report 'skipped' as test result and abort/skip the rest of the test.</div><div><br></div><div>We should apply the rule at scenario level, because If we in the future add another scenario, only the current one should be skipped (and only if run within a container).</div><div><br></div><div>The check to make sure we're not running inside a container should be reusable for other scenarios even beyond storage tests. So if we consider it functional, it would belong in the common library for functional steps: <i>plinth/tests/functional/step_definitions.py</i>, where the function which logs the user resides. But "being run on a container" sounds technical rather than functional, so it most likely belongs somewhere else under <i>plinth/tests</i>. Perhaps <i>__init__.py</i>? Or <i>config.py</i>?</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar, 8 jun 2021 a las 15:57, Tiago Zaniquelli via Freedombox-discuss (<<a href="mailto:freedombox-discuss@alioth-lists.debian.net">freedombox-discuss@alioth-lists.debian.net</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ok...<br>
<br>
I did the two suggestion...<br>
<br>
First(first.png)... it showed me skipped (test_list_disks)...<br>
<br>
Second(second_one.png, second_two.png)...it showed me a  error because some html... Is this error that need to correct?<br>
<br>
Regards,<br>
<br>
Tiago Zaniquelli<br>
<br>
<br>
Sent with ProtonMail Secure Email.<br>
<br>
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br>
Em segunda-feira, junho 7, 2021 7:39 PM, James Valleroy via Freedombox-discuss <<a href="mailto:freedombox-discuss@alioth-lists.debian.net" target="_blank">freedombox-discuss@alioth-lists.debian.net</a>> escreveu:<br>
<br>
> On 6/7/21 4:35 PM, Tiago Zaniquelli via Freedombox-discuss wrote:<br>
><br>
> > Ahhh, ok.<br>
> > I tried to simulate, but for me everything is ok, and I'm inside the container<br>
> > Could you help me simulate?<br>
><br>
> Note that the functional tests are skipped by default.<br>
> To include them, add the "--include-functional" option:<br>
><br>
> $ py.test-3 --include-functional plinth/modules/storage/tests/<br>
><br>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
><br>
> James<br>
><br>
> Freedombox-discuss mailing list<br>
> <a href="mailto:Freedombox-discuss@alioth-lists.debian.net" target="_blank">Freedombox-discuss@alioth-lists.debian.net</a><br>
> <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-discuss" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-discuss</a><br>
<br>
_______________________________________________<br>
Freedombox-discuss mailing list<br>
<a href="mailto:Freedombox-discuss@alioth-lists.debian.net" target="_blank">Freedombox-discuss@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-discuss" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/freedombox-discuss</a><br>
</blockquote></div>