summaryrefslogtreecommitdiff
path: root/tests/protocol/mockwiredata.py
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2016-09-13 16:11:47 +0100
committerusd-importer <ubuntu-server@lists.ubuntu.com>2016-09-14 10:39:12 +0000
commit5009a9d0f3606fc08a80ec0d59076d8dc48d2f25 (patch)
treead67eef74c5208178950db6ee28195e2137fa713 /tests/protocol/mockwiredata.py
parent0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6 (diff)
downloadvyos-walinuxagent-5009a9d0f3606fc08a80ec0d59076d8dc48d2f25.tar.gz
vyos-walinuxagent-5009a9d0f3606fc08a80ec0d59076d8dc48d2f25.zip
Import patches-unapplied version 2.1.5-0ubuntu1 to ubuntu/yakkety-proposed
Imported using git-ubuntu import. Changelog parent: 0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6 New changelog entries: * New upstream release (LP: #1603581) - d/patches/disable-auto-update.patch: - The new version introduces auto-updating of the agent to its latest version via an internal mechanism; disable this - d/patches/fix_shebangs.patch: - Dropped in favour of the dh_python3 --shebang option. - Refreshed d/patches/disable_udev_overrides.patch
Diffstat (limited to 'tests/protocol/mockwiredata.py')
-rw-r--r--tests/protocol/mockwiredata.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/protocol/mockwiredata.py b/tests/protocol/mockwiredata.py
index 6ffd19c..c789de5 100644
--- a/tests/protocol/mockwiredata.py
+++ b/tests/protocol/mockwiredata.py
@@ -14,13 +14,10 @@
#
# Requires Python 2.4+ and Openssl 1.0+
#
-# Implements parts of RFC 2131, 1541, 1497 and
-# http://msdn.microsoft.com/en-us/library/cc227282%28PROT.10%29.aspx
-# http://msdn.microsoft.com/en-us/library/cc227259%28PROT.13%29.aspx
from tests.tools import *
-from azurelinuxagent.future import httpclient
-from azurelinuxagent.utils.cryptutil import CryptUtil
+from azurelinuxagent.common.future import httpclient
+from azurelinuxagent.common.utils.cryptutil import CryptUtil
DATA_FILE = {
"version_info": "wire/version_info.xml",
@@ -30,6 +27,7 @@ DATA_FILE = {
"certs": "wire/certs.xml",
"ext_conf": "wire/ext_conf.xml",
"manifest": "wire/manifest.xml",
+ "ga_manifest" : "wire/ga_manifest.xml",
"trans_prv": "wire/trans_prv",
"trans_cert": "wire/trans_cert",
"test_ext": "ext/sample_ext.zip"
@@ -44,6 +42,15 @@ DATA_FILE_EXT_NO_SETTINGS["ext_conf"] = "wire/ext_conf_no_settings.xml"
DATA_FILE_EXT_NO_PUBLIC = DATA_FILE.copy()
DATA_FILE_EXT_NO_PUBLIC["ext_conf"] = "wire/ext_conf_no_public.xml"
+DATA_FILE_EXT_AUTOUPGRADE = DATA_FILE.copy()
+DATA_FILE_EXT_AUTOUPGRADE["ext_conf"] = "wire/ext_conf_autoupgrade.xml"
+
+DATA_FILE_EXT_INTERNALVERSION = DATA_FILE.copy()
+DATA_FILE_EXT_INTERNALVERSION["ext_conf"] = "wire/ext_conf_internalversion.xml"
+
+DATA_FILE_EXT_AUTOUPGRADE_INTERNALVERSION = DATA_FILE.copy()
+DATA_FILE_EXT_AUTOUPGRADE_INTERNALVERSION["ext_conf"] = "wire/ext_conf_autoupgrade_internalversion.xml"
+
class WireProtocolData(object):
def __init__(self, data_files=DATA_FILE):
self.version_info = load_data(data_files.get("version_info"))
@@ -53,6 +60,7 @@ class WireProtocolData(object):
self.certs = load_data(data_files.get("certs"))
self.ext_conf = load_data(data_files.get("ext_conf"))
self.manifest = load_data(data_files.get("manifest"))
+ self.ga_manifest = load_data(data_files.get("ga_manifest"))
self.trans_prv = load_data(data_files.get("trans_prv"))
self.trans_cert = load_data(data_files.get("trans_cert"))
self.ext = load_bin_data(data_files.get("test_ext"))
@@ -73,6 +81,8 @@ class WireProtocolData(object):
content = self.ext_conf
elif "manifest.xml" in url:
content = self.manifest
+ elif "manifest_of_ga.xml" in url:
+ content = self.ga_manifest
elif "ExampleHandlerLinux" in url:
content = self.ext
resp = MagicMock()