[test] add hook function to plugin