hwcontext: Add test for device creation and derivation