Exemple #1
0
        public void TestIPAddressOfHost()
        {
            IXenObject host = GetAnyHost(h => h.name_label == "inflames");

            List <Uri> urls = Placeholders.SubstituteUri(@"http://{$ip_address}/hello_there", host);

            Assert.AreEqual(1, urls.Count, "Wrong number of urls returned");
            Assert.IsTrue(urls.Contains(new Uri(@"http://10.80.224.75/hello_there")), "Wrong url returned.");
        }
Exemple #2
0
        public void TestIPAddressOfStorage()
        {
            IXenObject sr = GetAnySR(s => s.name_label == "NFS ISO library");

            List <Uri> urls = Placeholders.SubstituteUri(@"http://{$ip_address}/hello_there", sr);

            Assert.AreEqual(1, urls.Count, "Wrong number of urls returned");
            Assert.IsTrue(urls.Contains(new Uri(@"http://telos/hello_there")), "Wrong url returned.");
        }
        public void TestInvalidIPAddressPlaceholder()
        {
            IXenObject vmWith2Networks = GetAnyVM(v => v.name_label == "Iscsi Box");

            List <Uri> urls = Placeholders.SubstituteUri(@"http://{$ip_adress}/hello_there", vmWith2Networks);

            Assert.AreEqual(1, urls.Count, "Wrong number of urls returned");
            Assert.IsTrue(urls.Contains(new Uri(@"about:blank")), "Wrong url returned.");
        }
Exemple #4
0
        public void TestIPAddressOfShutdownVM()
        {
            IXenObject shutdownVM = GetAnyVM(v => v.is_a_real_vm() && v.power_state == vm_power_state.Halted);

            List <Uri> urls = Placeholders.SubstituteUri(@"http://{$ip_address}/hello_there", shutdownVM);

            Assert.AreEqual(1, urls.Count, "Wrong number of urls returned");
            Assert.IsTrue(urls.Contains(new Uri(@"about:blank")), "Wrong url returned.");
        }
        public void TestIPAddressTemplate()
        {
            IXenObject template = GetAnyUserTemplate();

            List <Uri> urls = Placeholders.SubstituteUri(@"http://{$ip_address}/hello_there", template);

            Assert.AreEqual(1, urls.Count, "Wrong number of urls returned");
            Assert.IsTrue(urls.Contains(new Uri(@"about:blank")), "Wrong url returned.");
        }