livepatch-charmers team mailing list archive
-
livepatch-charmers team
-
Mailing list archive
-
Message #00187
Re: [Merge] ~barryprice/canonical-livepatch-charm/+git/canonical-livepatch-charm:master into canonical-livepatch-charm:master
Review: Approve lgtm
one remark inline
Diff comments:
> diff --git a/tests/99-autogen b/tests/99-autogen
> index f4bb24e..f4b0af9 100755
> --- a/tests/99-autogen
> +++ b/tests/99-autogen
> @@ -97,6 +97,41 @@ class TestDeployment(unittest.TestCase):
> '.cfg'.format(test_context_name))
> self.assertEqual(exit_code, 0)
>
> +
> + def test_channel_change(self):
> + livepatch = self.deployment.sentry['canonical-livepatch'][0]
> +
> + # verify the current channel
> + output, exit_code = livepatch.run('snap info canonical-livepatch')
> + self.assertEqual(exit_code, 0)
> +
> + # confirm we're tracking 'stable'
snap info's output appears to be yaml:
[agnew(~)] snap info canonical-livepatch | python -c 'import sys,yaml ; print yaml.safe_load(sys.stdin.read())["tracking"]'
stable
[agnew(~)] _
> + channel = ''
> + for line in output.split('\n'):
> + if line.startswith('tracking:'):
> + channel = line.strip().split(' ')[-1]
> + self.assertEqual(channel, 'stable')
> +
> + # change channel to 'beta'
> + self.deployment.configure('canonical-livepatch', {
> + 'snap_channel': 'beta',
> + })
> +
> + # wait for that to settle
> + sleep(30)
> +
> + # verify the current channel
> + output, exit_code = livepatch.run('snap info canonical-livepatch')
> + self.assertEqual(exit_code, 0)
> +
> + # confirm we're tracking 'beta'
> + channel = ''
> + for line in output.split('\n'):
> + if line.startswith('tracking:'):
> + channel = line.strip().split(' ')[-1]
> + self.assertEqual(channel, 'beta')
> +
> +
> def test_nagios_servicegroup_change(self):
> livepatch = self.deployment.sentry['canonical-livepatch'][0]
>
--
https://code.launchpad.net/~barryprice/canonical-livepatch-charm/+git/canonical-livepatch-charm/+merge/354942
Your team Livepatch charm developers is subscribed to branch canonical-livepatch-charm:master.
References