Add test class and setup method.
Mock method/operator will be added in individual commits which use
that method or operator.
Story: 2007082
Task: 37998
Change-Id: I60a4b235417f288adb4a13577b9779d79169a233
Signed-off-by: Mingyuan Qi <mingyuan.qi@intel.com>
pylint checks were excluding the unit tests folder.
It is now included.
The following pylint errors needed to be fixed in the unit tests
- wildcard import (tests.db)
- duplicate-key (fornodeid was listed twice in one test structure)
- function-redefined (test_storage_tier.py)
- dangerous-default-value (using a list as a default)
- no-member (rename a class to end in Mixin to avoid these checks)
Change-Id: I1095d54542e1e7b3d07865e1e7b4cd46f14dc407
Story: 2007082
Task: 38081
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
When attempting to apply stx-monitor app without the required elastic
labels, user will get an error message detailing what is missing.
This label was enhanced to be more readable and provide instructions
on how to apply the missing labels.
Moved utility methods up to the super class LabelTestCase. Also
moved host definitions to each of the test classes since
LabelAssignTestCase require hosts to be locked and
StxAppLabelsTest require hosts to be unlocked.
Added the following enhanced logic:
1. All controller nodes are required to have all 4 elastic labels
2. At least one worker node should have elastic-master label.
3. Add label value validation and print error message for invalid
values.
Change-Id: I0b2bc7b87d2e8bf78bfbba455d499c52e1a72349
Closes-Bug: 1856763
Signed-off-by: abdelfattah saafan <abdelfattah.saafan@windriver.com>
This will fix below scenario:
Controller-0 is installed and some configs were applied. Config
f5d83753-c485-4221-b4aa-e986f5421d6d is the target config and requests
boot.
After controller-0 is unlocked and reboot.another request with uuid
29c89b7e-51fe-40cb-8700-e22c83ed5fa9 is coming,then the config_target is
set to a9c89b7e-51fe-40cb-8700-e22c83ed5fa9;
Once 29c89b7e-51fe-40cb-8700-e22c83ed5fa9 was applied,the config should
be cleared, but because 29c89b7e-51fe-40cb-8700-e22c83ed5fa9 is not same
as a9c89b7e-51fe-40cb-8700-e22c83ed5fa9,the alarm can not be cleared.
In this fix, tracking list for reboot config and clear it once config is
applied. the out of date config will be clear if reboot config tracking
is empty and config_applied w/ reboot config flag is equal config_target
Closes-Bug: 1851874
Change-Id: Iabeab338bc3fb4615cefcff9e4ae9402e4216321
Signed-off-by: Sun Austin <austin.sun@intel.com>
Adding unit test for nova_api_proxy helm data generation.
Change-Id: Icd62ad584e2f3bb0332455ab8458cd8fa585ae09
Story: 2007082
Task: 37994
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
The sysinv code has imports for python components but does
not have all of those specified as rpm dependencies.
Adding:
python-jsonpatch (used by several sysinv/api/controllers/v1/*)
python-keystoneauth1 (used by sysinv/common/fm)
python-keystonemiddleware (used by sysinv/api/acl)
python-oslo-serialization (used by sysinv/conductor/manager)
python-oslo-service (used by sysinv/common/wsgi_service)
python-paste (used by api config file)
python-psutil (used by sysinv/api/controllers/v1/host)
python-requests (used by sysinv/common/ceph)
python-retrying (used by sysinv/agent/manager)
python-stevedore (used by sysinv/puppet)
python-webob (used by sysinv/api/hooks)
This is a protective commit, since this only works because other
packages are pulling in the dependencies, and those packages can be
updated or removed in the future, thus breaking sysinv.
Change-Id: I9457e3817ae8d219ef0c582b0b0177510a8ec4b0
Story: 2004515
Task: 37985
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Lower the elasticsearch curator limits to take into account the
elasticsearch cluster.routing.allocation.disk settings and increase
the cronjob frequency to run every half hour.
Change-Id: I7eee7d6ad8a1eb2210a4a9c10c8ff8782783c192
Closes-Bug: 1858436
Signed-off-by: Kevin Smith <kevin.smith@windriver.com>
Removing sysinv.openstack.common.lockutils
The newer lockutils file is located in oslo_concurrency.
Only unit tests were using the older lockutils.
The following pylint error codes are no longer suppressed:
E0611: no-name-in-module
E1124: redundant-keyword-arg
Change-Id: I060523571e94857beb7a65cef72bbb367aa1bbc5
Story: 2006796
Task: 37962
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This is similar to upstream submissions in 2013 such as
https://review.opendev.org/#/c/56705/
We currently build, test and ship with a newer version
of sqlalchemy-migrate 0.11.0 so we do not need to handle
0.7.3 workarounds and patches.
This review also fixes: tests.db.sqlalchemy.test_migrations
which would fail when tested in isolation, due to its environment
not being initialized properly, but working if certain other tests
were run first.
Some skipped tests are now also enabled.
Change-Id: I6ce73491f7a2471f25c7691dab8b53dc354619a2
Story: 2004515
Task: 37954
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Update the lmon to support datanetwork interface monitoring
and use collectd to control the alarm information. Now lmon
will obtain the list of interfaces from /etc/lmon/lmon.conf
which can be generated by puppet.
Change-Id: Id886c935d54158eca44d6685f1e282c20367b9a4
Story: #2002948
Task: #37326
Depends-on: https://review.opendev.org/#/c/694927
Signed-off-by: marvin <weifei.yu@intel.com>
When _config_apply_runtime_manifest is run with force=True, it will
generate hieradata for all hosts, even hosts that have yet to come
online and are still uninventoried. Because the node is still
uninventoried, the hieradata will have an incomplete network config
with only the loopback interface configured.
When those hosts come online for the first time, they will mount
/opt/platform and check for their hieradata, and because it exists,
apply their puppet manifests with that hieradata, which will bring down
all non-loopback interfaces and make the node go offline and become
unreachable.
This commit adds a check to only generate hieradata for inventoried
hosts, even when force=True.
Closes-bug: 1856617
Change-Id: I37c611e9a1047d5651844c71351f40d939977b6f
Signed-off-by: Joseph Richard <joseph.richard@windriver.com>
This commit adds a semantic check to prevent provisioning an sriov
interface without a mgmt interface configured. This is necessary to
prevent an invalid network config being generated and applied, which
causes the node to lose connectivity over mgmt and become unreachable.
Closes-bug: 1853329
Change-Id: I783447a2214a1b0f4d698ac20037f8f1e8083958
Signed-off-by: Joseph Richard <joseph.richard@windriver.com>
Adding kubernetes health checks when a kubernetes upgrade is
started to ensure the kubernetes cluster is healthy. Also
adding a new "system health-query-kube-upgrade" command to
do the health checks without starting a kubernetes upgrade.
Change-Id: Ib3a491e25a6cb523cfd9f08e74879e5c0a25d4f7
Story: 2006781
Task: 37583
Depends-On: https://review.opendev.org/#/c/700197/
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
Mox is only being used by unit tests.
There is an openstack governance directive to remove mox:
https://storyboard.openstack.org/#!/story/2001546
Many unit tests were able to be updated based on
similar work in ironic. Ex:
https://review.opendev.org/#/c/50729/
Removed two oslo incubator files under sysinv.openstack.common.fixture:
mockpatch (unused)
moxstubout
Change-Id: Ie90a9c9e5a3028575d016f6eccf0ad118495d482
Story: 2006796
Task: 37851
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
The python kubernetes client requires a newer version of eventlet.
However, newer versions of eventlet have an issue with the subprocess
module, which requires subprocess to be imported from eventlet.green
instead of being imported directly. See:
https://github.com/eventlet/eventlet/issues/413
To allow eventlet to be upversioned (from 0.18.4 to 0.24.1), the
subprocess imports are being changed for code that runs with
eventlet.
Change-Id: Idf221c5c1fa542fbe2d9231dff441ec9289a93f1
Story: 2006781
Task: 37583
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
Moving incorrectly located stand-alone scripts from the
sysinv/cmd directory to the scripts directory. These scripts
appeared to be using eventlet due to the __init__.py file in the
sysinv/cmd directory, but were not, as they are moved to the
/bin directory at installation time.
This is being done in preparation for upversioning eventlet.
Change-Id: I511d61e14b3eb1511cee03aa0e36ffd1277e79ab
Story: 2006781
Task: 37583
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
The eventlet_backdoor was part of oslo incubator and
is now located in oslo_service.
There is no code in StarlingX that uses eventlet_backdoor.
Change-Id: I7ed15c7ad5261dac07c4c786ae14eddb147ff71d
Story: 2006796
Task: 37826
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This reverts commit 45d62bf02e309b7c5e3356ff39a28b749fbcc633.
This commit is causing issues with partition management due
to the manage-partitions command not using eventlet. It could
also be causing issues with the query_pci_id command for the
same reason.
Change-Id: I6088b14d0c860c44b363e2e78903744f88308c6b
The python kubernetes client requires a newer version of eventlet.
However, newer versions of eventlet have an issue with the subprocess
module, which requires subprocess to be imported from eventlet.green
instead of being imported directly. See:
https://github.com/eventlet/eventlet/issues/413
To allow eventlet to be upversioned (from 0.18.4 to 0.24.1), the
subprocess imports are being changed.
Change-Id: I884e8e539864f26b3593e9c15a29bbd099c94453
Story: 2006781
Task: 37583
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
Since OBS is not working correctly for CentOS and we are stopping openSUSE
for now, no point it having this template run those OBS jobs.
Change-Id: I75310fbeff26bd4d6f022750e3921da3ec5c82cf
Signed-off-by: Saul Wold <sgw@linux.intel.com>
This submit increases the size of the “value” field for the
service-parameter table from 255 to 4096 characters. This is
to accommodate registries that can be saved as a list in
this field.
This change was tested in lab with a size of 4096 and 4097
for no_proxy's value.
Closes-Bug: 1856236
Change-Id: I5067f7ee1e5f8b532045d0736402080bad39be72
Signed-off-by: Kristine Bujold <kristine.bujold@windriver.com>
The old oslo incubator uuidutils is being removed and the
version in oslo_utils is being used instead.
Change-Id: Ie57c55974ec34e04d4604f84e3e882cc000bb92b
Story: 2006796
Task: 37425
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Users have the option to allocate hugepage memory by # of
pages or percent of memory available.
Percent allocation is allocated on boot.
Story: 2006755
Task: 37245
CLI:
Allocating by percentage:
system host-memory-modify -2M 50% controller-0 0
Allocating by # of pages
system host-memory-modify -2M 50 controller-0 0
Testcases:
Allocating hugepage memory by percentage
Allocating hugepage memory by number of pages
Correct percentage is allocated if available memory
changes
100% of hugepage memory allocates correctly
Check error is raised if user attempts to allocate
percentage not in range of 0%-100%
Confirm that Horizon GUI can set as both percent and
integer
Confirm that hugepage changes are made before unlock
and after unlock
Change-Id: I6f1165c22e409e261c0b065f7d6cf5407647b56e
Signed-off-by: Andrew Troake <andrew.troake@windriver.com>