<p></p>
<p><b>@fjmolinas</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/15446#discussion_r524230362">tests/riotboot/tests/01-run.py</a>:</p>
<pre style='color:#555'>>  
 
 if __name__ == "__main__":
-    sys.exit(run(testfunc))
+    res = 1
+    global current_app_ver
+    global current_slot_num
+    # set current slot number and app version
+    res = run(testcurrent)
</pre>
<p>Well I'm not very good at this, and so It is indeed dirty, but I'm under the impression that <code>run()</code> only returns an exit code, so either <code>1</code> or <code>0</code> from what I see in code.</p>
<p>What I need to to is <code>detach</code> the terminal before flashing because the <code>cc2538-bsl</code> script flashes over serial and therefore I can't have the terminal open when flashing.</p>
<p><code>run(testfunc)</code> among others spawns a terminal and the terminal remains attached until <code>testfunc</code> exits. And so to be able to flash to <code>slot0</code> and <code>slot1</code> I need to be able to do the following:</p>
<ul>
<li>attach terminal</li>
<li>get current slot and app version</li>
<li>detach terminal</li>
<li>flash to the other slot with newer app version</li>
<li>attach terminal</li>
<li>check everything is OK</li>
<li>detach terminal</li>
<li>flash to the other slot with newer app version</li>
<li>attach terminal</li>
<li>check everything is OK</li>
<li>test passed</li>
</ul>
<p>Having multiple <code>run(testfunc)</code> allows handling proper attaching/detaching every time</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/15446#discussion_r524230362">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYERNGIDDLKUQYGSEHTSQEMRLANCNFSM4TW4Z6IQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYHT3IXPP5TPDAPZ7PLSQEMRLA5CNFSM4TW4Z6I2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOD6VLVDY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/15446#discussion_r524230362",
"url": "https://github.com/RIOT-OS/RIOT/pull/15446#discussion_r524230362",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>