added new test cases, fixed CDN upgrade, integrated SAM upgrade with CDN as well