Skip to content

Update domain tests for RFC-20#151

Merged
lsf37 merged 2 commits intoseL4:masterfrom
Indanz:domain
Mar 24, 2026
Merged

Update domain tests for RFC-20#151
lsf37 merged 2 commits intoseL4:masterfrom
Indanz:domain

Conversation

@Indanz
Copy link
Copy Markdown
Contributor

@Indanz Indanz commented Mar 2, 2026

Test with seL4/seL4#1511.

@Indanz Indanz force-pushed the domain branch 2 times, most recently from 73cdbbc to 4b8947f Compare March 8, 2026 19:43
@Indanz Indanz mentioned this pull request Mar 8, 2026
5 tasks
@Indanz Indanz force-pushed the domain branch 3 times, most recently from 4070855 to 5161356 Compare March 13, 2026 16:51
@lsf37
Copy link
Copy Markdown
Member

lsf37 commented Mar 14, 2026

The tests looks good to me, any idea why we are getting the PC99_debug_DOM_clang_32 simulation failure?

The end of the log is this:

  	<testcase classname="sel4test" name="DOMAINS0001">
  
  Running test DOMAINS0001 (Change domain successfully())
  
  +++ python3 ../projects/seL4_libs/libsel4test/tools/extract_results.py -q results.xml parsed_results.xml
  Failed to strip leading and trailing garbage

which could be a timeout, although I would have hoped that I'd put a timeout message in the script if it stopped because of one.

The same test does not seem to time out for other platforms and it should be platform independent. Maybe the default 1GHz assumption is not right for qemu?

@Indanz
Copy link
Copy Markdown
Contributor Author

Indanz commented Mar 15, 2026

which could be a timeout, although I would have hoped that I'd put a timeout message in the script if it stopped because of one.

No, the old tests don't test anything. You're supposed to enable debug prints and check that the result is what you'd expect.

I'm busy improving them and turning them into proper tests.

That said, detecting hangs would complicate individual tests which currently are very simple. (In this case, just two seL4_DomainSet_Set calls.)

Best way to handle timeouts is to have generic test timeout handling in the upper test layer. But considering there isn't even a generic fault handler and how wanting the test infrastructure is, I'm not keen on wasting too much time on this (I'd rather spend my time on rewriting the whole thing personally, to reduce over all complexity). Better to reduce the timeouts in CI for now.

The same test does not seem to time out for other platforms and it should be platform independent. Maybe the default 1GHz assumption is not right for qemu?

That test doesn't use those. It was caused by the ksDomScheduleIdx = domScheduleLength - 1; instead of -2.

@lsf37
Copy link
Copy Markdown
Member

lsf37 commented Mar 20, 2026

(Still squashing and style update to do, but I'm happy with the content)

Signed-off-by: Indan Zupancic <indan@nul.nu>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
@lsf37 lsf37 merged commit aebc744 into seL4:master Mar 24, 2026
24 checks passed
@lsf37 lsf37 moved this from In Progress to Done in seL4 March'26 release (31 March) Mar 24, 2026
@Indanz
Copy link
Copy Markdown
Contributor Author

Indanz commented Mar 24, 2026

Maybe trivial, but I think you meant to say CMake style instead of camke style. Too late to change though. :-)

@lsf37
Copy link
Copy Markdown
Member

lsf37 commented Mar 24, 2026

Indeed I did. Sorry about that.

Comment on lines 149 to +152
error = seL4_DomainSet_Set(env->domain, CONFIG_NUM_DOMAINS - 1,
env->tcb);
/* Reset our domain */
seL4_DomainSet_Set(env->domain, 0, env->tcb);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks weird? Are both of these lines still needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, can't remember whether it was just undoing any changes the test does, or for a specific reason.

I also don't know whether sel4test creates a new task for each tests or not. If it does, then it's redundant for sure.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that the added seL4_DomainSet_Set() function call comes directly after another seL4_DomainSet_Set() function call to the same tcb. So the previous call looks like it should be removed?

I think this line should either be removed, or a comment added explaining why the the cleanup needs to set the domain first to CONFIG_NUM_DOMAINS - 1 and then again to 0 for the same thread.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not an actual test? It is setting the domain of the current thread and then resetting it. The reset might not be needed if the thread is suspended anyway afterwards, but it does look cleaner to me to leave it in the domain it started in.

Copy link
Copy Markdown
Contributor Author

@Indanz Indanz Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the first line is the actual test, hence we store the result in error.
The second line is the cleanup.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohhh. The way that GitHub ux was presenting the change it looked like this was a test cleanup function...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants