コード例 #1
0
        private static void GetMetadataNetworkInterfacesTest(NetworkInterfacesJson[] input,
                                                             Dictionary <PhysicalAddress, List <IPAddress> > expected)
        {
            InstanceJson instance = MetadataJsonHelpers.GetInstanceMetadataJson(networkInterfaces: input);
            MetadataJson metadata = MetadataJsonHelpers.GetMetadataJson(instance: instance);

            Assert.Equal <Dictionary <PhysicalAddress, List <IPAddress> > >(expected, Reader.GetMetadata(metadata));
        }
コード例 #2
0
        private static MetadataJson CreateTestMetadata(string windowsKeys, bool disableAccountManager = false)
        {
            AttributesJson attributes = MetadataJsonHelpers.GetAttributesJson(
                windowsKeys: windowsKeys,
                disableAccountsManager: disableAccountManager);
            InstanceJson instance = MetadataJsonHelpers.GetInstanceMetadataJson(attributes: attributes);

            return(MetadataJsonHelpers.GetMetadataJson(instance: instance));
        }
コード例 #3
0
        private static MetadataJson CreateTestMetadata(string[] forwardAddresses, bool disableAddressManager = true)
        {
            AttributesJson attributes = MetadataJsonHelpers.GetAttributesJson(
                disableAddressManager: disableAddressManager);
            InstanceJson instance = MetadataJsonHelpers.GetInstanceMetadataJson(
                attributes,
                new[] { MetadataJsonHelpers.GetNetworkInterfacesJson(inputIPs: forwardAddresses) });

            return(MetadataJsonHelpers.GetMetadataJson(instance: instance));
        }