Find all files in the current directory (and its subdirectories) whose name contains the word "test" and for each of those files, search for the pattern "pattern".
find ./ -name '*test*' | xargs -I{} grep 'pattern' {}