We put 1 teaspoon of olive oil in our dutch oven (a large heavy bottomed pot with a lid).
We smash our garlic cloves on our cutting board, remove and discard the peels, and place the smashed cloves into the oil. We cook gently, uncovered, on medium-low heat. We just want to infuse the oil with the garlic, we do not want the cloves to brown.
Meanwhile, we slice the mushrooms and halve each slice. When the garlic is starting to sizzle, we remove them to a clean plate with our tongs and reserve. We add the mushrooms and cook over medium heat for a few minutes until they are browned and have released their liquid. We pour the cooked mushrooms onto another clean plate and cover with aluminum foil. Then we add the rest of the olive oil to the dutch oven along with the chopped onions and sauté on medium-low heat until translucent. This takes about 5 more minutes.
We remove the dutch oven from the heat, and spoon the onions and smashed garlic into our blender. We pour the tomato liquid from the can of tomatoes into the dutch oven, and put the whole tomatoes into the blender. We purée the tomatoes with the onions and garlic until smooth.
We pour the puréed sauce into our dutch oven and add the dried basil, fresh parsley stem, salt & pepper, hot pepper flakes, and a bay leaf. We then simmer the sauce for about 15 minutes, partially covered, over medium low heat.
When the sauce has cooked for a couple of minutes, the water for the pasta is boiling. We add some salt and the frozen cavatelli. We stir and taste after 8 minutes. It still is quite hard so we keep checking it every minute or two. After about 12 minutes, the pasta is cooked. We drain it in our colander and put the pasta back in the drained pot. We add a little of the sauce to the pasta to coat and set aside for a minute while we finish the sauce.
We add the mushrooms and chopped parsley to the sauce, taste for salt and pepper, and turn off the heat.
We serve the cavatelli with the mushroom sauce and top with Locatelli cheese.