@ -581,7 +581,9 @@ class TestUndercloudUpgrade(TestPluginV1):
@mock.patch ( ' os.mkdir ' )
@mock.patch ( ' tripleoclient.utils.write_env_file ' , autospec = True )
@mock.patch ( ' subprocess.check_call ' , autospec = True )
def test_undercloud_upgrade_default ( self , mock_subprocess ,
@mock.patch ( ' tripleoclient.utils.run_command ' , autospec = True )
def test_undercloud_upgrade_default ( self , mock_run_command ,
mock_subprocess ,
mock_wr ,
mock_os , mock_copy , mock_user ,
mock_getuid ) :
@ -591,6 +593,13 @@ class TestUndercloudUpgrade(TestPluginV1):
# DisplayCommandBase.take_action() returns two tuples
self . cmd . take_action ( parsed_args )
mock_run_command . assert_called_with (
[ ' sudo ' , ' dnf ' , ' upgrade ' , ' -y ' ,
' openstack-tripleo-heat-templates ' ,
' openstack-tripleo-validations ' ,
' tripleo-ansible ' ] ,
name = ' Update extra packages '
)
mock_subprocess . assert_called_with (
[ ' sudo ' , ' --preserve-env ' , ' openstack ' , ' tripleo ' , ' deploy ' ,
@ -648,7 +657,9 @@ class TestUndercloudUpgrade(TestPluginV1):
@mock.patch ( ' os.mkdir ' )
@mock.patch ( ' tripleoclient.utils.write_env_file ' , autospec = True )
@mock.patch ( ' subprocess.check_call ' , autospec = True )
def test_undercloud_upgrade_with_heat_enabled ( self , mock_subprocess ,
@mock.patch ( ' tripleoclient.utils.run_command ' , autospec = True )
def test_undercloud_upgrade_with_heat_enabled ( self , mock_run_command ,
mock_subprocess ,
mock_wr , mock_os ,
mock_copy , mock_user ,
mock_getuid ) :
@ -659,6 +670,14 @@ class TestUndercloudUpgrade(TestPluginV1):
# DisplayCommandBase.take_action() returns two tuples
self . cmd . take_action ( parsed_args )
mock_run_command . assert_called_with (
[ ' sudo ' , ' dnf ' , ' upgrade ' , ' -y ' ,
' openstack-tripleo-heat-templates ' ,
' openstack-tripleo-validations ' ,
' tripleo-ansible ' ] ,
name = ' Update extra packages '
)
mock_subprocess . assert_called_with (
[ ' sudo ' , ' --preserve-env ' , ' openstack ' , ' tripleo ' , ' deploy ' ,
' --standalone ' , ' --standalone-role ' , ' Undercloud ' , ' --stack ' ,
@ -714,7 +733,9 @@ class TestUndercloudUpgrade(TestPluginV1):
@mock.patch ( ' os.mkdir ' )
@mock.patch ( ' tripleoclient.utils.write_env_file ' , autospec = True )
@mock.patch ( ' subprocess.check_call ' , autospec = True )
def test_undercloud_upgrade_with_heat_true ( self , mock_subprocess ,
@mock.patch ( ' tripleoclient.utils.run_command ' , autospec = True )
def test_undercloud_upgrade_with_heat_true ( self , mock_run_command ,
mock_subprocess ,
mock_wr , mock_os ,
mock_copy , mock_user ,
mock_getuid ) :
@ -725,6 +746,14 @@ class TestUndercloudUpgrade(TestPluginV1):
# DisplayCommandBase.take_action() returns two tuples
self . cmd . take_action ( parsed_args )
mock_run_command . assert_called_with (
[ ' sudo ' , ' dnf ' , ' upgrade ' , ' -y ' ,
' openstack-tripleo-heat-templates ' ,
' openstack-tripleo-validations ' ,
' tripleo-ansible ' ] ,
name = ' Update extra packages '
)
mock_subprocess . assert_called_with (
[ ' sudo ' , ' --preserve-env ' , ' openstack ' , ' tripleo ' , ' deploy ' ,
' --standalone ' , ' --standalone-role ' , ' Undercloud ' , ' --stack ' ,
@ -780,7 +809,9 @@ class TestUndercloudUpgrade(TestPluginV1):
@mock.patch ( ' os.mkdir ' )
@mock.patch ( ' tripleoclient.utils.write_env_file ' , autospec = True )
@mock.patch ( ' subprocess.check_call ' , autospec = True )
def test_undercloud_upgrade_with_heat_and_yes ( self , mock_subprocess ,
@mock.patch ( ' tripleoclient.utils.run_command ' , autospec = True )
def test_undercloud_upgrade_with_heat_and_yes ( self , mock_run_command ,
mock_subprocess ,
mock_wr , mock_os ,
mock_copy , mock_user ,
mock_getuid ) :
@ -791,6 +822,14 @@ class TestUndercloudUpgrade(TestPluginV1):
# DisplayCommandBase.take_action() returns two tuples
self . cmd . take_action ( parsed_args )
mock_run_command . assert_called_with (
[ ' sudo ' , ' dnf ' , ' upgrade ' , ' -y ' ,
' openstack-tripleo-heat-templates ' ,
' openstack-tripleo-validations ' ,
' tripleo-ansible ' ] ,
name = ' Update extra packages '
)
mock_subprocess . assert_called_with (
[ ' sudo ' , ' --preserve-env ' , ' openstack ' , ' tripleo ' , ' deploy ' ,
' --standalone ' , ' --standalone-role ' , ' Undercloud ' , ' --stack ' ,
@ -847,7 +886,9 @@ class TestUndercloudUpgrade(TestPluginV1):
@mock.patch ( ' os.mkdir ' )
@mock.patch ( ' tripleoclient.utils.write_env_file ' , autospec = True )
@mock.patch ( ' subprocess.check_call ' , autospec = True )
def test_undercloud_upgrade_with_heat_and_debug ( self , mock_subprocess ,
@mock.patch ( ' tripleoclient.utils.run_command ' , autospec = True )
def test_undercloud_upgrade_with_heat_and_debug ( self , mock_run_command ,
mock_subprocess ,
mock_wr , mock_os ,
mock_copy , mock_user ,
mock_getuid ) :
@ -861,6 +902,14 @@ class TestUndercloudUpgrade(TestPluginV1):
self . cmd . take_action ( parsed_args )
self . cmd . app_args . verbose_level = old_verbose
mock_run_command . assert_called_with (
[ ' sudo ' , ' dnf ' , ' upgrade ' , ' -y ' ,
' openstack-tripleo-heat-templates ' ,
' openstack-tripleo-validations ' ,
' tripleo-ansible ' ] ,
name = ' Update extra packages '
)
mock_subprocess . assert_called_with (
[ ' sudo ' , ' --preserve-env ' , ' openstack ' , ' tripleo ' , ' deploy ' ,
' --standalone ' , ' --standalone-role ' , ' Undercloud ' , ' --stack ' ,