Cxbx-Reloaded / xbox_kernel_test_suite

Xbox kernel APIs tester written using nxdk
GNU General Public License v3.0
22 stars 6 forks source link

Add tests for IoCreateSymbolicLink and IoDeleteSymbolicLink #68

Closed RadWolfie closed 3 years ago

RadWolfie commented 3 years ago

Draft pull request due to missing status defines in nxdk's repo.


Add tests for IoCreateSymbolicLink and IoDeleteSymbolicLink against hardware to return expected result. From hardware test: (updated)

0x0043 - IoCreateSymbolicLink: Tests Starting
  Function 'IoCreateSymbolicLink' returned 0x0 as expected
  Function 'IoCreateSymbolicLink' returned 0xc0000035 as expected
  Running tests for symbolic link inputs
  Function 'IoCreateSymbolicLink' returned 0x0 as expected
  Function 'IoCreateSymbolicLink' returned 0xc0000033 as expected
  Function 'IoCreateSymbolicLink' returned 0xc0000033 as expected
  Function 'IoCreateSymbolicLink' returned 0xc0000033 as expected
  Function 'IoCreateSymbolicLink' returned 0xc000003a as expected
  Function 'IoCreateSymbolicLink' returned 0xc000003a as expected
  Function 'IoCreateSymbolicLink' returned 0xc000003a as expected
  Running tests for device inputs
  Function 'IoCreateSymbolicLink' returned 0xc000000d as expected
  Function 'IoCreateSymbolicLink' returned 0xc000000d as expected
  Function 'IoCreateSymbolicLink' returned 0x0 as expected
  Function 'IoCreateSymbolicLink' returned 0xc000000d as expected
  Function 'IoCreateSymbolicLink' returned 0xc0000034 as expected
  Function 'IoCreateSymbolicLink' returned 0xc000000d as expected
  Function 'IoCreateSymbolicLink' returned 0xc000000d as expected
  Function 'IoCreateSymbolicLink' returned 0xc000000d as expected
0x0043 - IoCreateSymbolicLink: All tests PASSED
0x0045 - IoDeleteSymbolicLink: Tests Starting
  Function 'IoDeleteSymbolicLink' returned 0x0 as expected
  Function 'IoDeleteSymbolicLink' returned 0xc0000034 as expected
  Function 'IoDeleteSymbolicLink' returned 0xc0000033 as expected
  Function 'IoDeleteSymbolicLink' returned 0xc0000033 as expected
  Function 'IoDeleteSymbolicLink' returned 0xc0000033 as expected
0x0045 - IoDeleteSymbolicLink: All tests PASSED

Cxbx-Reloaded does not respect expected return result, so it needs some work to make corrections.

ergo720 commented 3 years ago

You have forgotten to add a space between &= and assert_NTSTATUS in tests_passed &=assert_NTSTATUS.

RadWolfie commented 3 years ago

NOTICE: Cxbx-Reloaded will crash as of commit cc1edc6. Except it does not crash on the hardware. The result can be found in op post.

ergo720 commented 3 years ago

NOTICE: Cxbx-Reloaded will crash as of commit cc1edc6.

In that case then I don't think we should merge this until the crash is solved. This, because the test suite is specifically used to test the kernel implementation of cxbxr. If it crashes, then we can't use it, which effectively makes it useless.

PatrickvL commented 3 years ago

Or, see it as an incentive to fix the Cxbx-Reloaded kernel implementation

ergo720 commented 3 years ago

I used in the past the test suite to test the correctness of the implementation of RtlInitUnicodeString in cxbxr after I updated it in https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/pull/1969. If this is merged as is, then I won't be able to do that again in the future. So, if you want this anyway, I instead propose to disable the test that causes the crash, with a comment which explains the reason for this, in order to still allow people to check the correctness of the cxbxr kernel implementation when it's updated, Once the crash is fixed, the test can be enabled again here.

RadWolfie commented 3 years ago

@ergo720 I had been considering to fix the crash in currently active pull request https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/pull/2178. 😉 It's being work on at the moment.

ergo720 commented 3 years ago

I saw that this commit https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/pull/2178/commits/45e4e18415e5383dad4ce43d7c92503970aa9e46 supposedly fixes the crash that was previously reported. If confirmed, then we can merge this now.

EDIT; I got confirmation that the crash in cxbxr is fixed, so merging this.