I am convinced that the EPA and other testing authorities knew of this cheating. I worked in the diesel industry for 35 years and know the difficulty of meeting the emission standards and the methods used to achieve them.
CARB and others were willing to turn their heads at problems if the public impression was one of CART achieving even higher levels of regulation..they worried about the appearance, but not real reduction emissions. Back when smog was a real problem their work was effective, but once that objective was achieved the rest has been just for show.
It is also possible that VW was paying off govt officials. German companies have often used illegal payoffs to achieve market share.
One-Two PUNCH!! First, kill'em with the flood of Islamists, then kill their car companies!