[WIP - TO BE REBASED] Self-test script