The authorities were actually staging a technological survival exercise to ensure that the country could have an alternative internet when foreign powers in the case of Iran meddled in its affairs or a hostile power in the case of Russia attempted to cut them off from the system.
The Russian test was carried out in phases and users didn't report any problems, such as not being able to use Wikipedia or Amazon, thus all indications suggest that it was a success. In Iran the same thing happened. Banks managed to operate and the national communication systems suffered the least.
Contrary to speculations, Russia and Iran have no intention to isolate themselves from the international online community. Rather, their people and the economy in which they work are as plugged into the web as any other developed country.
The authorities have been doing their utmost to protect them from any hybrid warfare that could throw the countries into chaos by disconnecting them for an indefinite period of time. This is a very real threat since most of the internet infrastructure is outside borders and beyond their control.
It would be irresponsible for any country involved in tensions with a technological superpower, such as the US which incidentally hosts most of the internet infrastructure, to not engage in contingency planning for a worst-case scenario or even comparatively more benign situations, such as a series of accidents that indefinitely render transoceanic submarine communications cables inoperable.
It's difficult to imagine the consequences if internet-connected power grids suddenly went offline without any alternative means to reboot them.
Therein lays the strategic intention behind Russia's and Iran’s recent internet test. The guiding concept was to prove that the internal internet capabilities could suffice in ensuring the continuation of critical power, communication, economic and other infrastructures in such crisis scenarios. It's every nation's responsibility to protect their people from these modern threats, and each state has the sovereign right to do so when it is necessary.
Other examples of the applicability of this exercise include the efforts to contain the spread of a global virus that infected the world's internet infrastructure. Russia and Iran with these technological capabilities for that matter, could disconnect themselves as a precautionary move. There’s no other way to protect Iran’s nuclear facilities, for instance.
Another variation of this scenario could be the US disconnecting a state suspected of covering up an online viral outbreak that could potentially spread worldwide if it isn't stopped soon enough. It doesn't matter in this case if that state is really suffering such a problem or not (or at least not to the extent that is suspected) since the pretext alone could be abused for strategic reasons to result in the same outcome of cutting the targeted state from the global internet for an indefinite period of time.
As humanity becomes more dependent on the internet, especially in the era of the Internet of Things, the weaponized shut-off of a country's online services by the US could be utterly devastating and even deadly.
In fact, one can even say that the US’ ability to do so amounts to a super-weapon of sorts because no other country has such capabilities on a global scale. Perhaps the only thing preventing it from wantonly wielding this super-weapon at will is the possibility that the US will immediately be suspected and its target could respond kinetically, including through the use of nuclear weapons if they fear that such a cyber attack is intended to precede a conventional or nuclear strike.
Therefore, it can be argued that the carrying out of such internet survival exercises is beneficial for world peace because it reduces the odds that an accidental disruption of their online connectivity per the submarine communications cables scenario or the nuclear scenario could be misinterpreted as an act of war by whoever their primary rival is at the time.
With that in mind, it would be beneficial if all leading countries with the technological capabilities could follow Russia's and Iran’s lead and begin testing their infrastructure's resilience to this hybrid war scenario just in case.