File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1616
1717from __future__ import print_function
1818import os
19+ import re
1920import shutil
2021import subprocess
2122import sys
@@ -328,6 +329,20 @@ def test_vm_lifecycle(vm_dir):
328329 os .unlink (f"{ VAGRANT_DIR } /Vagrantfile" )
329330
330331
332+ def test_vm_resumecycle (vm_dir ):
333+ """Test methods controlling the VM - up(), suspend(), resume()."""
334+ v = vagrant .Vagrant (vm_dir )
335+
336+ v .up ()
337+ assert v .RUNNING == v .status ()[0 ].state
338+
339+ v .suspend ()
340+ assert v .SAVED == v .status ()[0 ].state
341+
342+ v .resume ()
343+ assert v .RUNNING == v .status ()[0 ].state
344+
345+
331346def test_valid_config (vm_dir ):
332347 v = vagrant .Vagrant (vm_dir )
333348 v .up ()
@@ -688,6 +703,14 @@ def test_make_file_cm(test_dir):
688703 assert read_fh .read () == "one\n two\n "
689704
690705
706+ def test_vagrant_version ():
707+ v = vagrant .Vagrant ()
708+ VAGRANT_VERSION = v .version ()
709+ sys .stdout .write (f"vagrant_version(): { VAGRANT_VERSION } \n " )
710+ version_result = bool (re .match ("^[0-9.]+$" , VAGRANT_VERSION ))
711+ assert version_result is True
712+
713+
691714def _execute_command_in_vm (v , command ):
692715 """
693716 Run command via ssh on the test vagrant box. Returns a tuple of the
You can’t perform that action at this time.
0 commit comments