Really simple to explain :
How to rename
/folder1/something.test.html
/folder1/somethingElse.test.html
/folder2/againsomething.test.html
/canBeHereAl
For simple string suffix and prefix manipulation, I suggest you familiarize yourself with the shell's standard parameter expansion features ${VAR%suffix_to_remove} and ${VAR#prefix_to_remove}. These will work on any standard sh, not just bash:
test -> test2
for NAME in */*.test.html; do # NAME is, e.g., "dir/foo.test.html"
BASENAME=${NAME%.test.html} # BASENAME is "dir/foo"
mv "$NAME" "$BASENAME.test2.html";
done
test2 -> test is similar:
...
BASENAME=${NAME%.test2.html} # strip off .test2.html
...
You could also use the standard shell utilities basename and dirname to achieve something similar.