Exemple #1
0
        public void alertSpecServerTemplateViewIndex()
        {
            List <AlertSpec> alertSpecList = AlertSpec.index_serverTemplate(serverTemplateID, "default");

            Assert.IsNotNull(alertSpecList);
            Assert.IsTrue(alertSpecList.Count > 0);
        }
Exemple #2
0
        public void aletSpecServerArrayIndex()
        {
            List <AlertSpec> alertSpecList = AlertSpec.index_serverArray(liveTestServerArrayID);

            Assert.IsNotNull(alertSpecList);
            Assert.IsTrue(alertSpecList.Count > 0);
        }
Exemple #3
0
        public void alertSpecServerIndex()
        {
            List <AlertSpec> alertSpecList = AlertSpec.index(liveTestServerID);

            Assert.IsNotNull(alertSpecList);
            //TODO: I'm not entirely sure why this is currently failing...
            //Assert.IsTrue(alertSpecList.Count > 0);
        }
Exemple #4
0
        public void alertSpecServerTemplateFilterIndex()
        {
            List <AlertSpec> alertSpecList = AlertSpec.index_serverTemplate(serverTemplateID, "default");

            Assert.IsNotNull(alertSpecList);
            Assert.IsTrue(alertSpecList.Count > 0);
            List <Filter> filterSet = new List <Filter>();

            filterSet.Add(new Filter("name", FilterOperator.Equal, "cpu"));
            List <AlertSpec> filteredAlertSpecList = AlertSpec.index_serverTemplate(serverTemplateID, filterSet, "default");

            Assert.IsNotNull(filteredAlertSpecList);
            Assert.IsTrue(filteredAlertSpecList.Count > 0);
            Assert.IsTrue(filteredAlertSpecList.Count <= alertSpecList.Count);
        }
Exemple #5
0
        public void alertSpecServerFilterIndex()
        {
            List <AlertSpec> alertSpecList = AlertSpec.index(liveTestServerID, "default");

            Assert.IsNotNull(alertSpecList);

            //TODO: I'm not entirely sure why this is currently failing...
            //Assert.IsTrue(alertSpecList.Count > 0);
            List <Filter> filterSet = new List <Filter>();

            filterSet.Add(new Filter("name", FilterOperator.Equal, "cpu"));
            List <AlertSpec> filteredAlertSpecList = AlertSpec.index(liveTestServerID, filterSet, "default");

            Assert.IsNotNull(filteredAlertSpecList);

            //TODO: I'm not entirely sure why this is currently failing...
            //Assert.IsTrue(filteredAlertSpecList.Count > 0);
            Assert.IsTrue(filteredAlertSpecList.Count <= alertSpecList.Count);
        }
Exemple #6
0
        public void createReadUpdateDeleteAlertSpecServerArray()
        {
            string alertSpecID = AlertSpec.create_serverArray(">", "this is a description", "5", string.Empty, "cpu-0/cpu-idle", "alert spec name", string.Empty, "5", "value", "vote tag", "grow", liveTestServerArrayID);

            Assert.IsNotNull(alertSpecID);
            AlertSpec testAlertSpec = AlertSpec.show_serverArray(alertSpecID, liveTestServerArrayID);

            Assert.IsNotNull(testAlertSpec);
            bool updated = AlertSpec.update_serverArray("", "this is a new description", "", "", "", "", "", "", "", "", "", alertSpecID, liveTestServerArrayID);

            Assert.IsTrue(updated);
            AlertSpec testUpdatedAlertSpec = AlertSpec.show_serverTemplate(alertSpecID, liveTestServerArrayID);

            Assert.IsNotNull(testUpdatedAlertSpec);
            Assert.AreNotEqual <string>(testAlertSpec.description, testUpdatedAlertSpec.description);
            bool retVal = AlertSpec.destroy_serverArray(alertSpecID, serverTemplateID);

            Assert.IsTrue(retVal);
        }
Exemple #7
0
        public void createReadUpdateDeleteAlertSpec_forServer()
        {
            string alertSpecID = AlertSpec.create(">", "this is a description", "5", string.Empty, "cpu-0/cpu-idle", "alert spec name", "/api/servers/" + this.liveTestServerID, "5", "value", "vote tag", "grow");

            Assert.IsNotNull(alertSpecID);
            AlertSpec testAlertSpec = AlertSpec.show(alertSpecID);

            Assert.IsNotNull(testAlertSpec);
            bool updated = AlertSpec.update("", "this is a new description", "", "", "", "", "", "", "", "", "", alertSpecID);

            Assert.IsTrue(updated);
            AlertSpec testUpdatedAlertSpec = AlertSpec.show(alertSpecID);

            Assert.IsNotNull(testUpdatedAlertSpec);
            Assert.AreNotEqual <string>(testAlertSpec.description, testUpdatedAlertSpec.description);
            bool retVal = AlertSpec.destroy(alertSpecID);

            Assert.IsTrue(retVal);
        }