There are some procedures missing in this test. First, you need to look if mdadm is installed in the system before testing RAID. Then, you need to test the creation of a RAID device and check if it was successfully created. After that, you can try to create partitions on it and test if it exists.
And we definitely don't want to use real devices for testing creation. It might make sense to set up temporary loop device as a test disk where we can try to create and then remove RAID.
In principle I think we should test kpmcore's functionality of raid creation, not mdadm's.
Just running mdadm --create will simply print mdadm: an md device must be given in this mode