scripts: selftest: auto detect corenumber