summaryrefslogtreecommitdiff
path: root/Tests/Kernel
AgeCommit message (Collapse)Author
2022-10-04AK+Everywhere: Add AK_COMPILER_{GCC,CLANG} and use them most placesNico Weber
Doesn't use them in libc headers so that those don't have to pull in AK/Platform.h. AK_COMPILER_GCC is set _only_ for gcc, not for clang too. (__GNUC__ is defined in clang builds as well.) Using AK_COMPILER_GCC simplifies things some. AK_COMPILER_CLANG isn't as much of a win, other than that it's consistent with AK_COMPILER_GCC.
2022-09-26Tests/Kernel: Add tests to ensure we don't regress InodeVMObjectsLiav A
2022-09-24Revert "Tests/Kernel: Add tests to ensure we don't regress InodeVMObjects"Liav A
This reverts commit b0d555163bc724542ea6560a2bc82bc3b620c31d.
2022-09-20Kernel/Tests: Don't compile x86 IO for non-x86 buildsLiav A
x86 IO space is not relevant for non-x86 builds so it doesn't make sense to include it in such build as it will not compile anyway.
2022-09-16Tests/Kernel: Add tests to ensure we don't regress InodeVMObjectsLiav A
2022-08-24Tests/Kernel: Make sure inaccessible area in TestEFault is actually thatAndreas Kling
We were relying on luck to make the mapping before our first mmap() be inaccessible. Let's make it explicit.
2022-07-27Everywhere: Make the codebase more architecture awareUndefine
2022-07-19LibC: Remove the `LibPthread` interface targetTim Schumacher
2022-07-19Everywhere: Refer to `pthread.h` by its non-prefixed nameTim Schumacher
This removes a bit of noise from the following patches, where we will move the `pthread.h` header out of the `LibPthread` directory.
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-08Tests: Remove the RDTSC kernel crash testTim Schumacher
We will remove the RDTSC instruction restriction to allow QEMU to read an accurate time, so this will no longer crash and therefore fail the test.
2022-07-05Tests: Add tests for inheriting signal handlersTim Schumacher
2022-05-12Tests: Fix new GCC 12 warningsDaniel Bertalan
2022-05-05Everywhere: Purge all support and usage of framebuffer devicesLiav A
Long live the DisplayConnector object!
2022-05-05Everywhere: Rename FB prefix name ioctls => GRAPHICSLiav A
2022-05-02Kernel: Stop requiring working malloc for syscall.h includesPatrick Meyer
Fixes #13869
2022-04-03Tests: Make TestEFault not rely on automatic guard pagesAndreas Kling
I'm about to break automatic guard page allocation in sys$mmap(), so we need to fix this test to not rely on it.
2022-04-03Tests: Clear errno before syscalls in TestEFaultAndreas Kling
This makes the debug output a little more helpful.
2022-04-03Tests: Remove unused macro in TestEFaultAndreas Kling
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-24Userland+Tests: Convert File::read_link() from String to ErrorOr<String>Kenneth Myhra
This converts the return value of File::read_link() from String to ErrorOr<String>. The rest of the change is to support the potential of an Error being returned and subsequent release of the value when no Error is returned. Unfortunately at this stage none of the places affected can utililize our TRY() macro.
2022-03-04Kernel: Add support for SA_SIGINFOAli Mohammad Pur
We currently don't really populate most of the fields, but that can wait :^)
2022-01-24Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOrSam Atkins
Apologies for the enormous commit, but I don't see a way to split this up nicely. In the vast majority of cases it's a simple change. A few extra places can use TRY instead of manual error checking though. :^)
2022-01-14Tests: Unmap memory ranges on /dev/mem after testing mmap(2)Liav A
2022-01-08Kernel: Implement read functionality for MemoryDeviceLiav A
So far we only had mmap(2) functionality on the /dev/mem device, but now we can also do read(2) on it. The test unit was updated to check we are doing it safely.
2021-12-20Kernel: Return EINVAL when specifying -1 for setuid and similar syscallsLiav A
For setreuid and setresuid syscalls, -1 means to set the current uid/euid/gid/egid value, to be more convenient for programming. However, for other syscalls where we pass only one argument, there's no justification to specify -1. This behavior is identical to how Linux handles the value -1, and is influenced by the fact that the manual pages for the group of one argument syscalls that handle ID operations is ambiguous about this topic.
2021-12-12Tests: Add tests for sigwait/sigwaitinfo/sigtimedwaitIdan Horowitz
2021-12-01Tests: Add a test to ensure sigaltstack() is working correctlyIdan Horowitz
2021-10-31Kernel: Write test that crashes ProcFSBen Wiederhake
2021-10-27Kernel + WindowServer: Re-define the interface to framebuffer devicesLiav A
We create a base class called GenericFramebufferDevice, which defines all the virtual functions that must be implemented by a FramebufferDevice. Then, we make the VirtIO FramebufferDevice and other FramebufferDevice implementations inherit from it. The most important consequence of rearranging the classes is that we now have one IOCTL method, so all drivers should be committed to not override the IOCTL method or make their own IOCTLs of FramebufferDevice. All graphical IOCTLs are known to all FramebufferDevices, and it's up to the specific implementation whether to support them or discard them (so we require extensive usage of KResult and KResultOr, together with virtual characteristic functions). As a result, the interface is much cleaner and understandable to read.
2021-10-22Tests: Add a unit test to ensure the /dev/mem device works correctlyLiav A
To ensure everything works as expected, a unit test was added with multiple scenarios. This binary has to have the SetUID flag, and we also bind-mount the /usr/Tests directory to allow running of SetUID binaries.
2021-10-08Tests: Fix -Wunreachable-code warnings from clangNico Weber
2021-10-01Kernel: Move x86 IO instructions code into the x86 specific folderLiav A
2021-10-01Tests: Fix typosNico Weber
2021-09-16crash: Don't test for qemu-unsupported featureBen Wiederhake
See #10042 for details. In short: qemu doesn't seem to implement that feature, therefore the test correctly fails. However, that does not help us, so we skip that test.
2021-09-16crash: Run automatically during CIBen Wiederhake
2021-09-11Tests/Kernel: Fix test after off-by-one fix in Memory::is_user_range()Brian Gianforcaro
Commit 890c647e0f fixed an off-by-one bug, so the mapping of the page at the very end of the user address space now works correctly. This change adjusts the test so cover the corner cases the original version was designed too.validate.
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-02Tests: Remove all file(GLOB) from CMakeLists in TestsAndrew Kaster
Using a file(GLOB) to find all the test files in a directory is an easy hack to get things started, but has some drawbacks. Namely, if you add a test, it won't be found again without re-running CMake. `ninja` seems to do this automatically, but it would be nice to one day stop seeing it rechecking our globbed directories.
2021-08-03Tests: Add coverage for sys$alarm() success caseBrian Gianforcaro
2021-08-03Tests: Add coverage for sys$alarm() canceling a stale timerBrian Gianforcaro
This is a regression test to validate the functionality that was reported broken in #9071, where the kernel would spin attempting to cancel a stale timer.
2021-07-30Kernel: Unmapping a non-mapped region with munmap() should be a no-opAndreas Kling
Not a regression per se from 0fcb9efd86da4c15a1aee87503348c5bee875c51 since we were crashing before that which is obviously worse.
2021-07-30Tests: Validate unmapping 0x0 doesn't crash the KernelBrian Gianforcaro
Previously unmapping any offset starting at 0x0 would assert in the kernel, add a regression test to validate the fix. Co-authored-by: Federico Guerinoni <guerinoni.federico@gmail.com>
2021-07-23Tests: Add test coverage for sys$pledge(..) argument validationBrian Gianforcaro
2021-07-23Tests: Add test coverage for sys$unveil(..) argument validationBrian Gianforcaro
2021-07-18Tests: Make mmap test point to new kernel address tooPeter Bindels
During a recent commit the 64-bit kernel was moved to a different address, breaking this test (unnoticed). This fixes it, so we can turn on breaking x86_64 tests on the CI again.
2021-07-14Tests: Fix compile errors on ClangDaniel Bertalan
Since Clang enables a couple of warnings that we don't have in GCC, these were not caught before. Included fixes: - Use correct printf format string for `size_t` - Don't compare Nonnull(Ref|Own)Ptr` to nullptr - Fix unsigned int& => unsigned long& conversion
2021-07-11Utilities+Tests: Convert test_efault to be LibTest basedAndrew Kaster
This test exposed a kernel panic in is_user_range calculations, so let's convert it to be a LibTest test so we can prevent regressions in mmap, the page allocator, and the memory manager.
2021-07-07Tests: Build all tests on x86_64Gunnar Beutner
This builds some previously-disabled tests for x86_64.