Skip to content

Commit

Permalink
Pull request quattor#129: Fix tests failing due to removal of old os …
Browse files Browse the repository at this point in the history
…templates.

Merge in AQUILON_AQD/aqd from ~PRIYAJ/aquilon.aqd:priyaj/for_review/fix_tests to master

* commit 'cc9c9400132b5fdbf48b491408e99dbe82e1ec01':
  Fix tests failing due to removal of old os templates.
  • Loading branch information
priyaj1 committed May 20, 2022
2 parents fb52542 + cc9c940 commit 1989cdd
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 21 deletions.
1 change: 1 addition & 0 deletions tests/broker/brokertest.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def setUpClass(cls):
cls.sandboxdir = os.path.join(cls.config.get("broker", "templatesdir"),
cls.user)

cls.osversion = cls.config.get("archetype_aquilon", "default_osversion")
cls.template_extension = cls.config.get("panc", "template_extension")
cls.gzip_profiles = cls.config.getboolean("panc", "gzip_output")
if cls.gzip_profiles:
Expand Down
10 changes: 6 additions & 4 deletions tests/broker/test_justification.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
QPROD = "justify-qa"



class TestJustification(PersonalityTestMixin, TestBrokerCommand):

def test_100_setup(self):

command = ["add", "feature", "--feature", "testfeature",
Expand Down Expand Up @@ -451,23 +453,23 @@ def test_670_del_required_svc_reason(self):
def test_675_add_required_svc_reason_os(self):
command = ["add_required_service", "--service=chooser1",
"--archetype=aquilon", "--osname", "linux", "--osversion",
"5.1-x86_64"]
"6.1-x86_64"]
self.justificationmissingtest(command, auth=True, msgcheck=False)

command = ["add_required_service", "--service=chooser1",
"--archetype=aquilon", "--osname", "linux", "--osversion",
"5.1-x86_64"] + self.emergency_just_with_reason
"6.1-x86_64"] + self.emergency_just_with_reason
self.emergencynojustification(command)

def test_676_del_required_svc_reason_os(self):
command = ["del_required_service", "--service=chooser1",
"--archetype=aquilon", "--osname", "linux", "--osversion",
"5.1-x86_64"] + self.emergency_just_without_reason
"6.1-x86_64"] + self.emergency_just_without_reason
self.reasonmissingtest(command, auth=True, msgcheck=False)

command = ["del_required_service", "--service=chooser1",
"--archetype=aquilon", "--osname", "linux", "--osversion",
"5.1-x86_64"] + self.emergency_tcm_just_with_reason
"6.1-x86_64"] + self.emergency_tcm_just_with_reason
self.noouttest(command)

def test_680_add_static_route_reason(self):
Expand Down
14 changes: 8 additions & 6 deletions tests/broker/test_search_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_190_search_issues(self):
"unittest15.aqd-unittest.ms.com"]
out = self.commandtest(command)
self.matchoutput(out, "unixops-100", command)
self.matchoutput(out, "unixops-101", command)
##TBD self.matchoutput(out, "unixops-101", command)
self.matchoutput(out, "unixops-102", command)

def test_190_search_osissues(self):
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_199_search_issue_state_all(self):
"unittest15.aqd-unittest.ms.com",
"--state_all", "--category", "hw"]
out = self.commandtest(command)
self.matchoutput(out, "unixops-101", command)
#TBD self.matchoutput(out, "unixops-101", command)
self.matchoutput(out, "unixops-102", command)

command = ["update_issue", "--tracker", "unixops-101",
Expand Down Expand Up @@ -163,6 +163,7 @@ def test_199_search_issues_os_state(self):
osver = self.config.get("unittest", "linux_version_curr")
command = ["search", "issue", "--osversion", osver,
"--state", "closed"]
out = self.commandtest(command)
self.noouttest(command)

def test_199_search_issues_os_state_fullinfo(self):
Expand All @@ -176,7 +177,7 @@ def test_199_search_issues_os_state_fullinfo(self):
self.matchoutput(out, "State: open", command)
self.matchoutput(out, "Description: some issue description", command)
self.matchoutput(out, "Operating System: linux", command)
self.matchoutput(out, "Version: 6.1-x86_64", command)
self.matchoutput(out, "Version: 7.1-x86_64", command)

def test_199_search_issues_model(self):
command = ["search", "issue", "--model", "dl360g9", "--state_all"]
Expand Down Expand Up @@ -205,7 +206,7 @@ def test_199_search_issues_model_state_fullinfo(self):
self.matchoutput(out, "Model: dl360g9", command)
self.matchoutput(out, "Model Type: rackmount", command)
self.matchoutput(out, "Operating System: linux", command)
self.matchoutput(out, "Version: 6.1-x86_64", command)
self.matchoutput(out, "Version: 7.1-x86_64", command)
self.matchoutput(out, "Lifecycle: early_prod", command)

def test_200_show_issue_all(self):
Expand Down Expand Up @@ -309,7 +310,7 @@ def test_500_verify_fullinfo(self):
self.matchoutput(out, "Vendor: ibm", command)
self.matchoutput(out, "Version: 6.1-x86_64", command)
self.matchoutput(out, "Lifecycle: early_prod", command)
self.matchoutput(out, "Version: 5.1-x86_64", command)
self.matchoutput(out, "Version: 6.1-x86_64", command)

def test_500_host_list_filter_all_test(self):
hosts = ["unittest15.aqd-unittest.ms.com", "unittest02.one-nyp.ms.com"]
Expand All @@ -319,7 +320,8 @@ def test_500_host_list_filter_all_test(self):
"--category", "hw", "--state", "open", "--fullinfo"]

out = self.commandtest(command)
self.matchoutput(out, "unixops-101", command)
self.matchoutput(out, "unixops-001", command)
self.matchoutput(out, "unixops-102", command)

def test_500_verify_proto(self):
command = ["update_issue", "--tracker", "unixops-001",
Expand Down
10 changes: 6 additions & 4 deletions tests/broker/test_update_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,26 @@


class TestUpdateOS(TestBrokerCommand):


def test_100_check_host_for_cm(self):

command = "search host --host_environment prod --buildstatus ready" \
" --osname linux --osversion 6.1-x86_64 --archetype aquilon"
" --osname linux --osversion " + self.osversion + " --archetype aquilon"
out = self.commandtest(command.split())
self.matchoutput(out, "aquilon91.aqd-unittest.ms.com",
command)

def test_100_require_just(self):
self.justificationmissingtest(["update_os", "--archetype", "aquilon", "--osname", "linux",
"--osversion", "6.1-x86_64", "--lifecycle", "production"], auth=True,
"--osversion", self.osversion, "--lifecycle", "production"], auth=True,
msgcheck=False)

def test_110_not_require_just(self):
self.noouttest(["update_os", "--archetype", "aquilon", "--osname", "linux",
"--osversion", "6.1-x86_64", "--comments", "'Comments are not "
"--osversion", self.osversion, "--comments", "'Comments are not "
"harmful to change'"])

def test_120_require_just_success(self):
self.noouttest(["update_os", "--archetype", "aquilon", "--osname", "linux",
"--osversion", "6.1-x86_64", "--lifecycle", "production"] + self.valid_just_tcm)
"--osversion", self.osversion, "--lifecycle", "production"] + self.valid_just_tcm)
1 change: 0 additions & 1 deletion tests/templates/aquilon/os/linux/5.1-x86_64/config.tpl

This file was deleted.

1 change: 1 addition & 0 deletions tests/templates/aquilon/os/linux/7.1-x86_64/config.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
template os/linux/7.1-x86_64/config;
6 changes: 3 additions & 3 deletions tests/unittest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ datadir = %(srcdir)s/tests/broker/data
real_panc_location = /ms/dist/elfms/PROJ/panc/prod/lib/panc.jar

# Versions for the Linux models. These are used both for Aquilon and Aurora.
linux_version_curr = 6.1-x86_64
linux_version_prev = 5.1-x86_64
linux_version_curr = 7.1-x86_64
linux_version_prev = 6.1-x86_64

[archetype_aquilon]
default_grn_target = esp
default_osversion = 6.1-x86_64
default_osversion = 7.1-x86_64
default_osname = linux
host_grn_targets = esp,hlmplus,atarget
personality_grn_targets = esp,hlmplus,atarget
Expand Down
6 changes: 3 additions & 3 deletions tests/unittest.conf.noms
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ datadir = %(srcdir)s/tests/broker/data
real_panc_location = /usr/lib/panc.jar

# Versions for the Linux models. These are used both for Aquilon and Aurora.
linux_version_curr = 6.1-x86_64
linux_version_prev = 5.1-x86_64
linux_version_curr = 7.1-x86_64
linux_version_prev = 6.1-x86_64

[archetype_aquilon]
default_grn_target = esp
default_osversion = 6.1-x86_64
default_osversion = 7.1-x86_64
default_osname = linux
host_grn_targets = esp,hlmplus,atarget
personality_grn_targets = esp,hlmplus,atarget
Expand Down

0 comments on commit 1989cdd

Please sign in to comment.