[PATCH 4.19 485/521] ktest: introduce _get_grub_index