The purpose of the CIA chief's visit to Moscow this week was to warn Russia not to attack NATO member states, people familiar with the matter said, amid U.S. assessments that Russia could try to test NATO.