summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-11 20:41:30 +0000
committerGerrit Code Review <review@openstack.org>2019-02-11 20:41:30 +0000
commit348857cc4946f60c17322e8c861227b688f7a046 (patch)
tree046fb306c326beadad2fe7290e5ba9c0c55891b6
parent7af72995d0860dd20c4c6f254c276c2b9bccda39 (diff)
parent5133f09a0fb46c2de754e96c4d67cdb0154c966c (diff)
Merge "Add devstack job and fix linters"
-rw-r--r--.zuul.yaml35
-rw-r--r--devstack/lib/stx-metal187
-rw-r--r--devstack/plugin.sh40
-rw-r--r--devstack/settings29
-rw-r--r--tox.ini11
5 files changed, 181 insertions, 121 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index cc2f6cd..c31d414 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -8,6 +8,8 @@
8 - build-openstack-releasenotes 8 - build-openstack-releasenotes
9 - openstack-tox-linters 9 - openstack-tox-linters
10 - openstack-tox-pep8 10 - openstack-tox-pep8
11 - stx-devstack-metal:
12 voting: false
11 gate: 13 gate:
12 jobs: 14 jobs:
13 - build-openstack-api-ref 15 - build-openstack-api-ref
@@ -19,3 +21,36 @@
19 - publish-stx-api-ref 21 - publish-stx-api-ref
20 - publish-stx-tox 22 - publish-stx-tox
21 - publish-stx-releasenotes 23 - publish-stx-releasenotes
24
25- job:
26 name: stx-devstack-metal
27 parent: stx-devstack-base
28 timeout: 7800
29 required-projects:
30 - openstack/stx-update
31 - openstack/stx-fault
32 - openstack/stx-nfv
33 vars:
34 tox_envlist: functional
35 devstack_services:
36 horizon: false
37 # StarlingX services
38 fm-common: true
39 fm-api: true
40 mtce: true
41 mtce-compute: true
42 mtce-control: true
43 mtce-storage: true
44 fsmon: true
45 hbs: true
46 hwmon: true
47 mtcalarm: true
48 mtclog: true
49 pmon: true
50 rmon: true
51 devstack_plugins:
52 stx-fault: git://git.starlingx.io/stx-fault
53 stx-nfv: git://git.starlingx.io/stx-nfv
54 stx-update: git://git.starlingx.io/stx-update
55 files:
56 - ^devstack/.*
diff --git a/devstack/lib/stx-metal b/devstack/lib/stx-metal
index 2238643..8c30340 100644
--- a/devstack/lib/stx-metal
+++ b/devstack/lib/stx-metal
@@ -48,18 +48,77 @@ SW_VERSION=18.10
48# Functions 48# Functions
49# --------- 49# ---------
50 50
51function uninstall_files() {
52 local dest_dir=$1
53 local dest_file_array=($2)
54 local file=""
55 51
56 for (( i=0; i<${#dest_file_array[*]}; i++ )); do 52function build_mtce {
57 file=${dest_file_array[$i]##*/} 53 pushd ${STX_METAL_DIR}/mtce/src
58 sudo rm -rf $dest_dir/$file 54
59 done 55 local major minor version x
56
57 if [[ -z $1 || -z $2 ]]; then
58 # get mtce version
59 read x version <<< $(grep '^Version:' ${STX_METAL_DIR}/mtce/PKG-INFO)
60 major=${version%%.*}
61 minor=${version##*.}
62 else
63 major=$1
64 minor=$2
65 fi
66
67 # build
68 make \
69 MAJOR=${major} \
70 MINOR=${minor} \
71 CCFLAGS=' -g -O2 -Wall -Wextra -std=c++11 -DBUILDINFO="\"$$(date)\""' \
72 build
73
74 popd
75}
76
77function build_mtce_common {
78 pushd ${STX_METAL_DIR}/mtce-common/src
79
80 local major minor version x
81
82 if [[ -z $1 || -z $2 ]]; then
83 # get mtce-common version
84 read x version <<< $(grep '^Version:' ${STX_METAL_DIR}/mtce/PKG-INFO)
85 major=${version%%.*}
86 minor=${version##*.}
87 else
88 major=$1
89 minor=$2
90 fi
91
92 # build
93 make \
94 MAJOR=${major} \
95 MINOR=${minor} \
96 CCFLAGS=' -g -O2 -Wall -Wextra -std=c++11 -DBUILDINFO="\"$$(date)\""' \
97 build
98
99 popd
100}
101
102function install_maintenance {
103 install_mtce_common
104 # components could be seperately installed if
105 # installation is well controlled in Makefile
106 install_mtce
107
108 if is_service_enabled mtce-compute; then
109 install_mtce_compute
110 fi
111 if is_service_enabled mtce-control; then
112 install_mtce_control
113 fi
114 if is_service_enabled mtce-storage; then
115 install_mtce_storage
116 fi
60} 117}
61 118
62function install_mtce_common { 119function install_mtce_common {
120 pushd ${STX_METAL_DIR}/mtce-common/src
121
63 local x version 122 local x version
64 123
65 # get mtce-common version 124 # get mtce-common version
@@ -67,15 +126,13 @@ function install_mtce_common {
67 local major=${version%%.*} 126 local major=${version%%.*}
68 local minor=${version##*.} 127 local minor=${version##*.}
69 128
129 build_mtce_common
130
70 local lib64_dir=${PREFIX}/lib64 131 local lib64_dir=${PREFIX}/lib64
71 local inc_dir=${PREFIX}/include 132 local inc_dir=${PREFIX}/include
72 local inc_dir_common=${PREFIX}/include/mtce-common 133 local inc_dir_common=${PREFIX}/include/mtce-common
73 local inc_dir_daemon=${PREFIX}/include/mtce-daemon 134 local inc_dir_daemon=${PREFIX}/include/mtce-daemon
74 135
75 # build
76 pushd ${STX_METAL_DIR}/mtce-common/src
77 make MAJOR=${major} MINOR=${minor} CCFLAGS=' -g -O2 -Wall -Wextra -std=c++11 -DBUILDINFO="\"$$(date)\""' build
78
79 local libdaecom_file=( \ 136 local libdaecom_file=( \
80 "common/libcommon.a" \ 137 "common/libcommon.a" \
81 "common/libthreadUtil.a" \ 138 "common/libthreadUtil.a" \
@@ -200,6 +257,8 @@ function install_mtce_storage {
200} 257}
201 258
202function install_mtce { 259function install_mtce {
260 pushd ${STX_METAL_DIR}/mtce/src
261
203 local x version 262 local x version
204 263
205 # get mtce version 264 # get mtce version
@@ -207,6 +266,8 @@ function install_mtce {
207 local major=${version%%.*} 266 local major=${version%%.*}
208 local minor=${version##*.} 267 local minor=${version##*.}
209 268
269 build_mtce $major $minor
270
210 local bin_dir=${PREFIX}/local/bin 271 local bin_dir=${PREFIX}/local/bin
211 local sbin_dir=${PREFIX}/local/sbin 272 local sbin_dir=${PREFIX}/local/sbin
212 local lib_dir=${PREFIX}/lib 273 local lib_dir=${PREFIX}/lib
@@ -221,10 +282,6 @@ function install_mtce {
221 local local_etc_servicesd=${sysconf_dir}/services.d 282 local local_etc_servicesd=${sysconf_dir}/services.d
222 local local_etc_logrotated=${sysconf_dir}/logrotate.d 283 local local_etc_logrotated=${sysconf_dir}/logrotate.d
223 284
224 # build
225 pushd ${STX_METAL_DIR}/mtce/src
226 make MAJOR=${major} MINOR=${minor} CCFLAGS=' -g -O2 -Wall -Wextra -std=c++11 -DBUILDINFO="\"$$(date)\""' build
227
228 # install 285 # install
229 if [ ! -d "/etc/rc.d" ]; then 286 if [ ! -d "/etc/rc.d" ]; then
230 sudo mkdir -p /etc/rc.d 287 sudo mkdir -p /etc/rc.d
@@ -354,7 +411,7 @@ function install_mtce {
354 sudo install -m 644 -p -D rmon/scripts/oam_resource.conf ${sysconf_dir}/rmon_interfaces.d/oam_resource.conf 411 sudo install -m 644 -p -D rmon/scripts/oam_resource.conf ${sysconf_dir}/rmon_interfaces.d/oam_resource.conf
355 sudo install -m 644 -p -D rmon/scripts/management_resource.conf ${sysconf_dir}/rmon_interfaces.d/management_resource.conf 412 sudo install -m 644 -p -D rmon/scripts/management_resource.conf ${sysconf_dir}/rmon_interfaces.d/management_resource.conf
356 sudo install -m 644 -p -D rmon/scripts/infrastructure_resource.conf ${sysconf_dir}/rmon_interfaces.d/infrastructure_resource.conf 413 sudo install -m 644 -p -D rmon/scripts/infrastructure_resource.conf ${sysconf_dir}/rmon_interfaces.d/infrastructure_resource.conf
357 sudo install -m 755 -p -D rmon/scripts/query_ntp_servers.sh ${sysconf_dir}/rmonfiles.d/query_ntp_servers.sh 414 # sudo install -m 755 -p -D rmon/scripts/query_ntp_servers.sh ${sysconf_dir}/rmonfiles.d/query_ntp_servers.sh
358 sudo install -m 755 -p -D rmon/scripts/rmon_reload_on_cpe.sh ${local_etc_goenabledd}/rmon_reload_on_cpe.sh 415 sudo install -m 755 -p -D rmon/scripts/rmon_reload_on_cpe.sh ${local_etc_goenabledd}/rmon_reload_on_cpe.sh
359 416
360 # log rotation 417 # log rotation
@@ -380,14 +437,6 @@ function install_mtce {
380 sudo ln -sf librmonapi.so.${major} librmonapi.so.${major}.${minor} 437 sudo ln -sf librmonapi.so.${major} librmonapi.so.${major}.${minor}
381 sudo ln -sf librmonapi.so.${major} librmonapi.so 438 sudo ln -sf librmonapi.so.${major} librmonapi.so
382 popd 439 popd
383
384}
385
386function install_maintenance {
387 install_mtce_common
388 # components could be seperatly installed if
389 # installation is well controlled in Makefile
390 install_mtce
391} 440}
392 441
393function configure_maintenance { 442function configure_maintenance {
@@ -452,7 +501,6 @@ function configure_maintenance {
452} 501}
453 502
454function start_mtcAgent { 503function start_mtcAgent {
455 echo "trigger start mtc agent service"
456 # add admin compute endpoint 504 # add admin compute endpoint
457 if is_service_enabled nova; then 505 if is_service_enabled nova; then
458 source openrc admin admin 506 source openrc admin admin
@@ -470,8 +518,6 @@ function start_mtcAgent {
470} 518}
471 519
472function start_hbsAgent { 520function start_hbsAgent {
473 echo "trigger start hbs agent service"
474
475 # copy hbsAgent.service template to devstack 521 # copy hbsAgent.service template to devstack
476 sudo cp ${PREFIX}/lib/systemd/system/hbsAgent.service \ 522 sudo cp ${PREFIX}/lib/systemd/system/hbsAgent.service \
477 ${SYSCONFDIR}/systemd/system/devstack@hbsAgent.service 523 ${SYSCONFDIR}/systemd/system/devstack@hbsAgent.service
@@ -479,7 +525,6 @@ function start_hbsAgent {
479} 525}
480 526
481function start_hwmon { 527function start_hwmon {
482 echo "trigger start hwmon service"
483 # init hwmon 528 # init hwmon
484 iniset -sudo /etc/systemd/system/devstack@hwmon.service "Service" "Type" "forking" 529 iniset -sudo /etc/systemd/system/devstack@hwmon.service "Service" "Type" "forking"
485 iniset -sudo /etc/systemd/system/devstack@hwmon.service "Service" "PIDFile" "/var/run/hwmond.pid" 530 iniset -sudo /etc/systemd/system/devstack@hwmon.service "Service" "PIDFile" "/var/run/hwmond.pid"
@@ -491,16 +536,13 @@ function start_mtce_control {
491 # Oneshot goenabled control 536 # Oneshot goenabled control
492 sudo ${SYSCONFDIR}/init.d/goenabledControl start 537 sudo ${SYSCONFDIR}/init.d/goenabledControl start
493 538
494 if is_service_enabled mtce; then 539 if is_service_enabled mtce-agent || is_service_enabled mtce; then
495 echo "start mtcAgent"
496 start_mtcAgent 540 start_mtcAgent
497 fi 541 fi
498 if is_service_enabled hbs; then 542 if is_service_enabled hbs-agent || is_service_enabled hbs; then
499 echo "start hbsAgent"
500 start_hbsAgent 543 start_hbsAgent
501 fi 544 fi
502 if is_service_enabled hwmon; then 545 if is_service_enabled hwmon && is_service_enabled sysinv; then
503 echo "start hwmon"
504 start_hwmon 546 start_hwmon
505 fi 547 fi
506} 548}
@@ -524,45 +566,45 @@ function start_mtce_storage {
524} 566}
525 567
526function start_maintenance { 568function start_maintenance {
569 if is_service_enabled mtce-control; then
570 start_mtce_control
571 fi
572 if is_service_enabled mtce-compute; then
573 start_mtce_compute
574 fi
575 if is_service_enabled mtce-storage; then
576 start_mtce_storage
577 fi
578
527 start_goenabled 579 start_goenabled
528 580
529 if is_service_enabled hbs; then 581 if is_service_enabled hbs; then
530 echo "start hbs client service"
531 start_hbsClient 582 start_hbsClient
532 fi 583 fi
533 if is_service_enabled mtce; then 584 if is_service_enabled mtce; then
534 echo "start mtce client service"
535 start_mtcClient 585 start_mtcClient
536 fi 586 fi
537 if is_service_enabled rmon; then 587 if is_service_enabled rmon; then
538 echo "start rmon service"
539 start_rmon 588 start_rmon
540 fi 589 fi
541 if is_service_enabled mtclog; then 590 if is_service_enabled mtclog; then
542 echo "start mtclog service"
543 start_mtclog 591 start_mtclog
544 fi 592 fi
545 if is_service_enabled mtcalarm; then 593 if is_service_enabled mtcalarm; then
546 echo "start mtcalarm service"
547 start_mtcalarm 594 start_mtcalarm
548 fi 595 fi
549 if is_service_enabled fsmon; then 596 if is_service_enabled fsmon; then
550 echo "start fsmon service"
551 start_fsmon 597 start_fsmon
552 fi 598 fi
553 if is_service_enabled pmon; then 599 if is_service_enabled pmon; then
554 echo "start pmon service"
555 start_pmon 600 start_pmon
556 fi 601 fi
557 if is_service_enabled hostw; then 602 if is_service_enabled hostw; then
558 echo "start hostw service"
559 start_hostw 603 start_hostw
560 fi 604 fi
561} 605}
562 606
563function start_mtcClient { 607function start_mtcClient {
564 echo "trigger start mtce client service"
565
566 # copy mtcClient.service template to devstack 608 # copy mtcClient.service template to devstack
567 sudo cp ${PREFIX}/lib/systemd/system/mtcClient.service \ 609 sudo cp ${PREFIX}/lib/systemd/system/mtcClient.service \
568 ${SYSCONFDIR}/systemd/system/devstack@mtcClient.service 610 ${SYSCONFDIR}/systemd/system/devstack@mtcClient.service
@@ -570,8 +612,6 @@ function start_mtcClient {
570} 612}
571 613
572function start_hbsClient { 614function start_hbsClient {
573 echo "trigger start hbs client service"
574
575 # copy hbsClient.service template to devstack 615 # copy hbsClient.service template to devstack
576 sudo cp ${PREFIX}/lib/systemd/system/hbsClient.service \ 616 sudo cp ${PREFIX}/lib/systemd/system/hbsClient.service \
577 ${SYSCONFDIR}/systemd/system/devstack@hbsClient.service 617 ${SYSCONFDIR}/systemd/system/devstack@hbsClient.service
@@ -579,8 +619,6 @@ function start_hbsClient {
579} 619}
580 620
581function start_pmon { 621function start_pmon {
582 echo "trigger start pmon service"
583
584 # copy pmon.service template to devstack 622 # copy pmon.service template to devstack
585 sudo cp ${PREFIX}/lib/systemd/system/pmon.service \ 623 sudo cp ${PREFIX}/lib/systemd/system/pmon.service \
586 ${SYSCONFDIR}/systemd/system/devstack@pmon.service 624 ${SYSCONFDIR}/systemd/system/devstack@pmon.service
@@ -589,8 +627,6 @@ function start_pmon {
589} 627}
590 628
591function start_rmon { 629function start_rmon {
592 echo "trigger start rmon service"
593
594 # copy rmon.service template to devstack 630 # copy rmon.service template to devstack
595 sudo cp ${PREFIX}/lib/systemd/system/rmon.service \ 631 sudo cp ${PREFIX}/lib/systemd/system/rmon.service \
596 ${SYSCONFDIR}/systemd/system/devstack@rmon.service 632 ${SYSCONFDIR}/systemd/system/devstack@rmon.service
@@ -599,8 +635,6 @@ function start_rmon {
599} 635}
600 636
601function start_mtclog { 637function start_mtclog {
602 echo "trigger start mtclog service"
603
604 # copy mtclog.service template to devstack 638 # copy mtclog.service template to devstack
605 sudo cp ${PREFIX}/lib/systemd/system/mtclog.service \ 639 sudo cp ${PREFIX}/lib/systemd/system/mtclog.service \
606 ${SYSCONFDIR}/systemd/system/devstack@mtclog.service 640 ${SYSCONFDIR}/systemd/system/devstack@mtclog.service
@@ -609,8 +643,6 @@ function start_mtclog {
609} 643}
610 644
611function start_mtcalarm { 645function start_mtcalarm {
612 echo "trigger start mtcalarm service"
613
614 # copy mtcalarm.service template to devstack 646 # copy mtcalarm.service template to devstack
615 sudo cp ${PREFIX}/lib/systemd/system/mtcalarm.service \ 647 sudo cp ${PREFIX}/lib/systemd/system/mtcalarm.service \
616 ${SYSCONFDIR}/systemd/system/devstack@mtcalarm.service 648 ${SYSCONFDIR}/systemd/system/devstack@mtcalarm.service
@@ -619,13 +651,10 @@ function start_mtcalarm {
619} 651}
620 652
621function start_goenabled { 653function start_goenabled {
622 echo "trigger start goenabled service"
623 sudo ${SYSCONFDIR}/init.d/goenabled start 654 sudo ${SYSCONFDIR}/init.d/goenabled start
624} 655}
625 656
626function start_fsmon { 657function start_fsmon {
627 echo "trigger start fsmon service"
628
629 # copy fsmon.service template to devstack 658 # copy fsmon.service template to devstack
630 sudo cp ${PREFIX}/lib/systemd/system/fsmon.service \ 659 sudo cp ${PREFIX}/lib/systemd/system/fsmon.service \
631 ${SYSCONFDIR}/systemd/system/devstack@fsmon.service 660 ${SYSCONFDIR}/systemd/system/devstack@fsmon.service
@@ -634,8 +663,6 @@ function start_fsmon {
634} 663}
635 664
636function start_hostw { 665function start_hostw {
637 echo "trigger start hostw service"
638
639 # copy hostw.service template to devstack 666 # copy hostw.service template to devstack
640 sudo cp ${PREFIX}/lib/systemd/system/hostw.service \ 667 sudo cp ${PREFIX}/lib/systemd/system/hostw.service \
641 ${SYSCONFDIR}/systemd/system/devstack@hostw.service 668 ${SYSCONFDIR}/systemd/system/devstack@hostw.service
@@ -658,16 +685,13 @@ function stop_hwmon {
658function stop_mtce_control { 685function stop_mtce_control {
659 sudo ${SYSCONFDIR}/init.d/goenabledControl stop 686 sudo ${SYSCONFDIR}/init.d/goenabledControl stop
660 687
661 if is_service_enabled mtce; then 688 if is_service_enabled mtce-agent || is_service_enabled mtce; then
662 echo "stop mtcAgent"
663 stop_mtcAgent 689 stop_mtcAgent
664 fi 690 fi
665 if is_service_enabled hbs; then 691 if is_service_enabled hbs-agent || is_service_enabled hbs; then
666 echo "stop hbsAgent"
667 stop_hbsAgent 692 stop_hbsAgent
668 fi 693 fi
669 if is_service_enabled hwmon; then 694 if is_service_enabled hwmon && is_service_enabled sysinv; then
670 echo "stop hwmon"
671 stop_hwmon 695 stop_hwmon
672 fi 696 fi
673} 697}
@@ -720,42 +744,42 @@ function stop_maintenance {
720 stop_goenabled 744 stop_goenabled
721 745
722 if is_service_enabled pmon; then 746 if is_service_enabled pmon; then
723 echo "stop pmon service"
724 stop_pmon 747 stop_pmon
725 fi 748 fi
726 if is_service_enabled mtce; then 749 if is_service_enabled mtce; then
727 echo "stop mtce client service"
728 stop_mtcClient 750 stop_mtcClient
729 fi 751 fi
730 if is_service_enabled hbs; then 752 if is_service_enabled hbs; then
731 echo "stop hbs client service"
732 stop_hbsClient 753 stop_hbsClient
733 fi 754 fi
734 if is_service_enabled rmon; then 755 if is_service_enabled rmon; then
735 echo "stop rmon service"
736 stop_rmon 756 stop_rmon
737 fi 757 fi
738 if is_service_enabled mtclog; then 758 if is_service_enabled mtclog; then
739 echo "stop mtclog service"
740 stop_mtclog 759 stop_mtclog
741 fi 760 fi
742 if is_service_enabled mtcalarm; then 761 if is_service_enabled mtcalarm; then
743 echo "stop mtcalarm service"
744 stop_mtcalarm 762 stop_mtcalarm
745 fi 763 fi
746 if is_service_enabled fsmon; then 764 if is_service_enabled fsmon; then
747 echo "stop fsmon service"
748 stop_fsmon 765 stop_fsmon
749 fi 766 fi
750 if is_service_enabled hostw; then 767 if is_service_enabled hostw; then
751 echo "stop hostw service"
752 stop_hostw 768 stop_hostw
753 fi 769 fi
770
771 if is_service_enabled mtce-control; then
772 stop_mtce_control
773 fi
774 if is_service_enabled mtce-compute; then
775 stop_mtce_compute
776 fi
777 if is_service_enabled mtce-storage; then
778 stop_mtce_storage
779 fi
754} 780}
755 781
756function cleanup_metal { 782function cleanup_metal {
757 echo "cleanup_metal"
758
759 # TODO: move it to Makefile uninstall 783 # TODO: move it to Makefile uninstall
760 # remove mtce 784 # remove mtce
761 local x version 785 local x version
@@ -987,4 +1011,15 @@ function cleanup_metal {
987 fi 1011 fi
988} 1012}
989 1013
1014function uninstall_files {
1015 local dest_dir=$1
1016 local dest_file_array=($2)
1017 local file=""
1018
1019 for (( i=0; i<${#dest_file_array[*]}; i++ )); do
1020 file=${dest_file_array[$i]##*/}
1021 sudo rm -rf $dest_dir/$file
1022 done
1023}
1024
990$_XTRACE_STX_METAL 1025$_XTRACE_STX_METAL
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index 61dcc29..016ac3b 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -12,21 +12,9 @@ if is_service_enabled stx-metal; then
12 echo_summary "Pre-requires of stx-metal" 12 echo_summary "Pre-requires of stx-metal"
13 elif [[ "$1" == "stack" && "$2" == "install" ]]; then 13 elif [[ "$1" == "stack" && "$2" == "install" ]]; then
14 # Perform installation of source 14 # Perform installation of source
15 echo_summary "Install metal" 15 echo_summary "Install stx-metal"
16 # maintenance components should be installed in each node 16 # maintenance components should be installed in each node
17 install_maintenance 17 install_maintenance
18 if is_service_enabled mtce-compute; then
19 echo_summary "Install mtce compute specific services"
20 install_mtce_compute
21 fi
22 if is_service_enabled mtce-control; then
23 echo_summary "Install mtce control specific services"
24 install_mtce_control
25 fi
26 if is_service_enabled mtce-storage; then
27 echo_summary "Install mtce storage specific services"
28 install_mtce_storage
29 fi
30 elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then 18 elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
31 # Configure after the other layer 1 and 2 services have been configured 19 # Configure after the other layer 1 and 2 services have been configured
32 echo_summary "Configure metal" 20 echo_summary "Configure metal"
@@ -34,19 +22,6 @@ if is_service_enabled stx-metal; then
34 elif [[ "$1" == "stack" && "$2" == "extra" ]]; then 22 elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
35 # Initialize and start the metal services 23 # Initialize and start the metal services
36 echo_summary "Initialize and start metal " 24 echo_summary "Initialize and start metal "
37 if is_service_enabled mtce-control; then
38 echo_summary "Start mtce control specific services"
39 # Start Agents on controller node
40 start_mtce_control
41 fi
42 if is_service_enabled mtce-compute; then
43 echo_summary "Start mtce compute specific services"
44 start_mtce_compute
45 fi
46 if is_service_enabled mtce-storage; then
47 echo_summary "Start mtce storage specific services"
48 start_mtce_storage
49 fi
50 # Start services on each node 25 # Start services on each node
51 start_maintenance 26 start_maintenance
52 elif [[ "$1" == "stack" && "$2" == "test" ]]; then 27 elif [[ "$1" == "stack" && "$2" == "test" ]]; then
@@ -59,19 +34,6 @@ if is_service_enabled stx-metal; then
59 echo_summary "Stop metal services" 34 echo_summary "Stop metal services"
60 # Stop client services on each node 35 # Stop client services on each node
61 stop_maintenance 36 stop_maintenance
62 if is_service_enabled mtce-control; then
63 echo_summary "Stop mtce control specific services"
64 # Stop Agents on controller node
65 stop_mtce_control
66 fi
67 if is_service_enabled mtce-compute; then
68 echo_summary "Stop mtce compute specific services"
69 stop_mtce_compute
70 fi
71 if is_service_enabled mtce-storage; then
72 echo_summary "Stop mtce storage specific services"
73 stop_mtce_storage
74 fi
75 fi 37 fi
76 38
77 if [[ "$1" == "clean" ]]; then 39 if [[ "$1" == "clean" ]]; then
diff --git a/devstack/settings b/devstack/settings
index e9a4726..61a15ef 100644
--- a/devstack/settings
+++ b/devstack/settings
@@ -11,17 +11,33 @@
11# functionality maintenance services. 11# functionality maintenance services.
12# 12#
13# Current configuration supports All-in-One simplex mode. 13# Current configuration supports All-in-One simplex mode.
14#
15# Servcies
16# stx-metal - Overall enable for this plugin
17#
18# mtce
19# mtce-control
20# mtce-compute
21# mtce-storage
22#
23# mtce-components (include all of the below)
24# fsmon
25# hbs
26# hwmon
27# mtcalarm
28# mtclog
29# pmon
30# rmon
14 31
15STX_METAL_NAME=stx-metal 32STX_METAL_NAME=stx-metal
16 33
17######### Plugin Specific ########## 34######### Plugin Specific ##########
18# Enable service for node type 35# Enable service for node type
19enable_service $STX_METAL_NAME mtce-compute mtce-control mtce-storage 36enable_service $STX_METAL_NAME
20 37
21# TODO:remove the services enabled by default once 38if is_service_enabled mtce-components; then
22# stx-metal is completely enabled 39 enable_service fsmon hbs hwmon mtce mtcalarm mtclog pmon rmon
23# Enable service for components 40fi
24enable_service hbs mtce pmon rmon hwmon mtclog mtcalarm fsmon
25 41
26# Be careful to enable hostw, it will restart your host 42# Be careful to enable hostw, it will restart your host
27# if some config is not correct 43# if some config is not correct
@@ -42,6 +58,9 @@ if is_service_enabled mtce; then
42 enable_service mtcAgent 58 enable_service mtcAgent
43 enable_service mtcClient 59 enable_service mtcClient
44fi 60fi
61if is_service_enabled hwmon && is_plugin_enabled stx-config; then
62 enable_service sysinv
63fi
45 64
46# Initial source of lib script 65# Initial source of lib script
47source $DEST/stx-metal/devstack/lib/stx-metal 66source $DEST/stx-metal/devstack/lib/stx-metal
diff --git a/tox.ini b/tox.ini
index 154dfa3..5c34e39 100644
--- a/tox.ini
+++ b/tox.ini
@@ -24,7 +24,11 @@ commands =
24 -type f \ 24 -type f \
25 -not -name \*~ \ 25 -not -name \*~ \
26 -not -name \*.md \ 26 -not -name \*.md \
27 -name \*.sh \ 27 \( \
28 -name \*.sh \
29 -or -not -wholename \*/devstack/files/\* \
30 -wholename \*/devstack/\* \
31 \) \
28 -print0 | xargs -n 1 -0 bashate -v -i E010,E006" 32 -print0 | xargs -n 1 -0 bashate -v -i E010,E006"
29 bash -c "find {toxinidir} \ 33 bash -c "find {toxinidir} \
30 \( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \ 34 \( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \
@@ -86,3 +90,8 @@ commands =
86 rm -rf api-ref/build 90 rm -rf api-ref/build
87 sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html 91 sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
88whitelist_externals = rm 92whitelist_externals = rm
93
94[testenv:functional]
95basepython = python3
96whitelist_externals = cat
97commands = cat /etc/mtc.ini