From 4f2da1cc1d24cbc47025cc8613c0d3ec287a20f9 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Tue, 17 Nov 2020 16:37:29 -0500 Subject: introduce an upgrade framework and related testing (#659) This commit does the following: * introduces the `cloudinit.persistence` module, containing `CloudInitPickleMixin` which provides lightweight versioning of objects' pickled representations (and associated testing) * introduces a basic upgrade testing framework (in `cloudinit.tests.test_upgrade`) which unpickles pickles from previous versions of cloud-init (stored in `tests/data/old_pickles`) and tests invariants that the current cloud-init codebase expects * uses the versioning framework to address an upgrade issue where `Distro.networking` could get into an unexpected state, and uses the upgrade testing framework to confirm that the issue is addressed --- .../old_pickles/focal-20.1-10-g71af48df-0ubuntu5.pkl | Bin 0 -> 7135 bytes .../focal-20.3-2-g371b392c-0ubuntu1~20.04.1.pkl | Bin 0 -> 7215 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/data/old_pickles/focal-20.1-10-g71af48df-0ubuntu5.pkl create mode 100644 tests/data/old_pickles/focal-20.3-2-g371b392c-0ubuntu1~20.04.1.pkl (limited to 'tests/data/old_pickles') diff --git a/tests/data/old_pickles/focal-20.1-10-g71af48df-0ubuntu5.pkl b/tests/data/old_pickles/focal-20.1-10-g71af48df-0ubuntu5.pkl new file mode 100644 index 00000000..358813b4 Binary files /dev/null and b/tests/data/old_pickles/focal-20.1-10-g71af48df-0ubuntu5.pkl differ diff --git a/tests/data/old_pickles/focal-20.3-2-g371b392c-0ubuntu1~20.04.1.pkl b/tests/data/old_pickles/focal-20.3-2-g371b392c-0ubuntu1~20.04.1.pkl new file mode 100644 index 00000000..e26f98d8 Binary files /dev/null and b/tests/data/old_pickles/focal-20.3-2-g371b392c-0ubuntu1~20.04.1.pkl differ -- cgit v1.2.3