├── packages └── .gitkeep ├── vpn ├── ovpn-data │ └── .keep └── run.sh ├── templates ├── cache │ └── .gitkeep ├── md5sum.txt └── xmls │ ├── mbxt-kvm-el7.xml │ ├── mbxt-kvm-el8.xml │ ├── mbxt-kvm-el9.xml │ ├── mbxt-xcpng76.xml │ ├── mbxt-vmware67u3.xml │ ├── mbxt-xenserver71.xml │ ├── mbxt-xcpng82.xml │ ├── mbxt-vmware7.xml │ ├── mbxt-vmware8.xml │ ├── mbxt-xenserver84.xml │ ├── mbxt-xcpng83.xml │ └── mbxt-vmware8u3.xml ├── files ├── govc ├── vhd-util ├── libvhd.so.1.0 ├── sudoer.mbx ├── xenfix.sh ├── smoketests.sh ├── systemvm-map.json ├── result.py ├── aliasrc ├── createtmplt.sh ├── build.sh └── setup-systemvmtemplate.sh ├── .gitignore ├── doc ├── images │ ├── arch.png │ ├── box-start.png │ ├── virt-net.png │ └── virt-manager.png ├── scripts │ ├── nat.table │ └── filter.table ├── vmware.md ├── notes.md └── centos7.md ├── monkeynet.xml ├── marvin ├── examples │ ├── xenserver.marvin.cfg │ ├── kvm.marvin.cfg │ └── vmware.marvin.cfg ├── xen.cfg ├── kvm.cfg └── vmw.cfg ├── README.md └── mbx /packages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vpn/ovpn-data/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/cache/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /files/govc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shapeblue/mbx/HEAD/files/govc -------------------------------------------------------------------------------- /files/vhd-util: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shapeblue/mbx/HEAD/files/vhd-util -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | boxes/boxes.list 2 | boxes/** 3 | templates/*.qcow2 4 | templates/cache/* 5 | -------------------------------------------------------------------------------- /doc/images/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shapeblue/mbx/HEAD/doc/images/arch.png -------------------------------------------------------------------------------- /files/libvhd.so.1.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shapeblue/mbx/HEAD/files/libvhd.so.1.0 -------------------------------------------------------------------------------- /doc/images/box-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shapeblue/mbx/HEAD/doc/images/box-start.png -------------------------------------------------------------------------------- /doc/images/virt-net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shapeblue/mbx/HEAD/doc/images/virt-net.png -------------------------------------------------------------------------------- /doc/images/virt-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shapeblue/mbx/HEAD/doc/images/virt-manager.png -------------------------------------------------------------------------------- /monkeynet.xml: -------------------------------------------------------------------------------- 1 | 2 | monkeynet 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /files/sudoer.mbx: -------------------------------------------------------------------------------- 1 | Cmnd_Alias MBX = /usr/bin/mkdir, /bin/mkdir, /usr/bin/mkdir, /bin/mount, /usr/bin/umount, /bin/umount, /usr/bin/cp, /bin/cp, /usr/bin/chmod, /bin/chmod, /usr/bin/keytool, /bin/keytool, /usr/bin/virsh, /usr/sbin/ldconfig, /usr/sbin/sysctl, /usr/bin/rm -fr /export/testing/*, /export/monkeybox/files/setup-systemvmtemplate.sh 2 | 3 | Defaults:%sudo !requiretty 4 | 5 | %wheel ALL=(root) NOPASSWD:MBX 6 | %sudo ALL=(root) NOPASSWD:MBX 7 | 8 | -------------------------------------------------------------------------------- /doc/scripts/nat.table: -------------------------------------------------------------------------------- 1 | iptables -t nat -P POSTROUTING ACCEPT 2 | iptables -t nat -A POSTROUTING -s 172.20.0.0/16 -d 224.0.0.0/24 -j RETURN 3 | iptables -t nat -A POSTROUTING -s 172.20.0.0/16 -d 255.255.255.255/32 -j RETURN 4 | iptables -t nat -A POSTROUTING -s 172.20.0.0/16 ! -d 172.20.0.0/16 -p tcp -j MASQUERADE --to-ports 1024-65535 5 | iptables -t nat -A POSTROUTING -s 172.20.0.0/16 ! -d 172.20.0.0/16 -p udp -j MASQUERADE --to-ports 1024-65535 6 | iptables -t nat -A POSTROUTING -s 172.20.0.0/16 ! -d 172.20.0.0/16 -j MASQUERADE 7 | -------------------------------------------------------------------------------- /templates/md5sum.txt: -------------------------------------------------------------------------------- 1 | 879b98eaaa1f3288b86e5f2b6cf55363 kvm-el7.qcow2 2 | 4f5d49a16755e3ac787e77dab6a66f39 kvm-el8.qcow2 3 | 84b84f64b65db239545bd1f67b50230a kvm-el9.qcow2 4 | 1e52381c3f0f5a1f91a79c0e3a9edc22 vmware67u3.qcow2 5 | d67e523c507c4df1cf97ec53fbb38dfd vmware7.qcow2 6 | 5a0e2e8e7b4a93eef804b61b1caa5e47 vmware8.qcow2 7 | 034a82228c1f6dc91e7864763747cd89 vmware8u3.qcow2 8 | ddb5a5c3110d58c931af2d12dd4ee756 xcpng82.qcow2 9 | 188142ec7eceac82341e6340c14c77f1 xcpng83.qcow2 10 | 15a63f3cb7d42d7fbd69f8aae2dc4c75 xenserver71.qcow2 11 | 3b6d1e59d9e7699f4e9e3e3e3d5cefd8 xenserver84.qcow2 12 | -------------------------------------------------------------------------------- /doc/scripts/filter.table: -------------------------------------------------------------------------------- 1 | iptables -A INPUT -i virbr1 -p udp -m udp --dport 53 -j ACCEPT 2 | iptables -A INPUT -i virbr1 -p tcp -m tcp --dport 53 -j ACCEPT 3 | iptables -A INPUT -i virbr1 -p udp -m udp --dport 67 -j ACCEPT 4 | iptables -A INPUT -i virbr1 -p tcp -m tcp --dport 67 -j ACCEPT 5 | iptables -A FORWARD -d 172.20.0.0/16 -o virbr1 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 6 | iptables -A FORWARD -s 172.20.0.0/16 -i virbr1 -j ACCEPT 7 | iptables -A FORWARD -i virbr1 -o virbr1 -j ACCEPT 8 | iptables -A FORWARD -o virbr1 -j REJECT --reject-with icmp-port-unreachable 9 | iptables -A FORWARD -i virbr1 -j REJECT --reject-with icmp-port-unreachable 10 | iptables -A OUTPUT -o virbr1 -p udp -m udp --dport 68 -j ACCEPT 11 | -------------------------------------------------------------------------------- /vpn/run.sh: -------------------------------------------------------------------------------- 1 | OVPN_DATA="/export/monkeybox/vpn/ovpn-data" 2 | SERVER="192.168.1.100" 3 | 4 | if [ -z $(ls -A $OVPN_DATA) ]; then 5 | docker pull kylemanna/openvpn 6 | # Generate Data 7 | docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://$SERVER 8 | docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki 9 | fi 10 | 11 | # Start server 12 | docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn 13 | 14 | # Create user 15 | # docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full rohit-hp nopass 16 | # docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient rohit-hp > rohit-hp.ovpn 17 | -------------------------------------------------------------------------------- /files/xenfix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | service xapi stop 20 | sed -i "/INSTALLATION_UUID/c\INSTALLATION_UUID='$(uuidgen)'" /etc/xensource-inventory 21 | sed -i "/CONTROL_DOMAIN_UUID/c\CONTROL_DOMAIN_UUID='$(uuidgen)'" /etc/xensource-inventory 22 | rm -rf /var/xapi/state.db 23 | cert="/etc/xensource/xapi-ssl.pem" 24 | cert_backup="${cert}.`date -u +%Y%m%dT%TZ`" 25 | mv -f "${cert}" "${cert_backup}" 26 | /opt/xensource/libexec/generate_ssl_cert "${cert}" `hostname -f` 27 | service xapi start 28 | rm -f /etc/openvswitch/conf.db* 29 | sleep 5 30 | xe host-param-set uuid=$(xe host-list params=uuid|awk {'print $5'} | head -n 1) name-label=$(hostname) 31 | xe pool-enable-tls-verification || true 32 | echo yes | /opt/xensource/bin/xe-reset-networking --device=eth0 --mode=dhcp 33 | -------------------------------------------------------------------------------- /files/smoketests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | TESTDIR="/marvin/tests/smoke" 20 | LOGDIR="/marvin/log" 21 | 22 | # Remove tests that can't run 23 | rm -fv $TESTDIR/{test_hostha_simulator.py,test_kubernetes_clusters.py,test_outofbandmanagement_nestedplugin.py,test_outofbandmanagement.py,test_hostha_kvm.py} 24 | 25 | mkdir -p $LOGDIR 26 | 27 | NUMTESTS=`find $TESTDIR/test_*.py | wc -l` 28 | run_start_time="$(date -u +%s)" 29 | counter=1 30 | PASSES=0 31 | FILES=$(ls $TESTDIR/test_*py | grep -v test_host_maintenance | grep -v test_hostha_kvm) 32 | if [ -f /$TESTDIR/test_host_maintenance.py ]; then 33 | FILES="$FILES $TESTDIR/test_host_maintenance.py" 34 | fi 35 | if [ -f $TESTDIR/test_hostha_kvm.py ]; then 36 | FILES="$FILES $TESTDIR/test_hostha_kvm.py" 37 | fi 38 | 39 | for file in $FILES; do 40 | echo "Starting test: $file" 41 | nosetests-3.4 --with-xunit --xunit-file=$LOGDIR/$(basename $file).xml --with-marvin --marvin-config=marvin.cfg -s -a tags=advanced $file 42 | done 43 | 44 | -------------------------------------------------------------------------------- /doc/vmware.md: -------------------------------------------------------------------------------- 1 | vmware 7.0 -> vmxnet3 or e1000e 2 | older can use e1000 3 | 4 | # vmware esxi template 5 | 6 | enable ssh+shell 7 | disable ipv6 8 | enable vmotion on vmk0 9 | make vmk0 nic to get dhcp as phy nic and vmk0 network/tcp stack to obtain info from dhcp/dns 10 | 11 | security setting fort vSwtich0: reject/accept/accept 12 | 13 | remove uuid, mac address and IP address from /etc/vmware/esx.conf 14 | remove dhcp leases from /etc/ and /var/lib/dhcp/ paths 15 | esxcfg-advcfg -s 1 /Net/FollowHardwareMac 16 | 17 | # Stop hostd 18 | /etc/init.d/hostd stop 19 | 20 | # Ensure the new MAC Address is automatically picked up once cloned 21 | localcli system settings advanced set -o /Net/FollowHardwareMac -i 1 22 | 23 | # Remove any potential old DHCP leases 24 | rm -f /etc/dhclient*lease 25 | 26 | # Ensure new system UUID is generated 27 | sed -i 's#/system/uuid.*##g' /etc/vmware/esx.conf 28 | 29 | # VMware 7 only: Remove these lines from /etc/vmware/esx.conf: 30 | 31 | /net/vmkernelnic/child[0000]/mac 32 | /net/pnic/child[0001]/mac 33 | /net/pnic/child[0000]/mac 34 | 35 | # Unload networking + vmfs3 modules which also contains system UUID mappings 36 | vmkload_mod -u vmfs3 37 | vmkload_mod -u e1000 (before VMware 7) 38 | vmkload_mod -u nvmxnet3 (VMware 7 only) 39 | 40 | # vCenter VM 41 | 42 | vcenter VM: enable bash and ssh, enable ntp pool, disable password expiry; 43 | on setup use FDQN as vcenterXX.local and add entry in local router (forward and reverse dns) 44 | 45 | from the VC.vmx remove: 46 | ethernet0.addressType 47 | uuid.location = 48 | uuid.bios = 49 | ethernet0.generatedAddress = 50 | ethernet0.generatedAddressOffset = 51 | 52 | In VC.vmx add at bottom: (replace vmwareXX.local pnid) 53 | 54 | guestInfo.cis.deployment.node.type = "embedded" 55 | guestInfo.cis.appliance.net.addr.family = "ipv4" 56 | guestInfo.cis.appliance.net.mode = "dhcp" 57 | guestInfo.cis.appliance.net.pnid = "vcenter70.local" 58 | guestInfo.cis.appliance.ssh.enabled = "True" 59 | 60 | vcenter debug services: 61 | service-control --stop --all 62 | service-control --start --all 63 | -------------------------------------------------------------------------------- /doc/notes.md: -------------------------------------------------------------------------------- 1 | sshpass example: 2 | sshpass -p 'P@ssword123' ssh -o StrictHostKeyChecking=no root@qa-ry-xs1 3 | 4 | get host/ip from virsh via: 5 | ip=$(getent hosts qa-ry-c7kvm1 | awk '{ print $1 }') 6 | 7 | virsh list | awk '{ print $2 }' | xargs getent hosts 8 | 9 | For KVM: 10 | fix hostname 11 | fix repo URL/yum 12 | rm /etc/default/cloudstack-agent 13 | rm /etc/cloudstack/agent/agent.properties /etc/cloudstack/agent/environment.properties 14 | yum install -y cloudstack-agent 15 | 16 | For Vmware: 17 | manually start VC and then add hosts to Cluster 18 | then deploy zone 19 | 20 | For XenServer: 21 | on master, run: 22 | xe pool-param-set name-label=XS-Cluster1 uuid=`xe pool-list --minimal` 23 | Deploy Zone, and then run on nodes: 24 | HOSTNAME=$PASS_HOST_NAME_HERE 25 | service xapi stop 26 | sed -i "/INSTALLATION_UUID/c\INSTALLATION_UUID='$(uuidgen)'" /etc/xensource-inventory 27 | sed -i "/CONTROL_DOMAIN_UUID/c\CONTROL_DOMAIN_UUID='$(uuidgen)'" /etc/xensource-inventory 28 | rm -rf /var/xapi/state.db 29 | cert="/etc/xensource/xapi-ssl.pem" 30 | cert_backup="${cert}.`date -u +%Y%m%dT%TZ`" 31 | mv -f "${cert}" "${cert_backup}" 32 | /opt/xensource/libexec/generate_ssl_cert "${cert}" `hostname -f` 33 | service xapi start 34 | rm -f /etc/openvswitch/conf.db* 35 | sleep 10 36 | xe host-param-set uuid=$(xe host-list params=uuid|awk {'print $5'} | head -n 1) name-label=$HOSTNAME 37 | echo yes | /opt/xensource/bin/xe-reset-networking --device=eth0 --mode=dhcp 38 | #reboot 39 | xe pool-join master-address=172.20.0.194 master-username=root master-password=P@ssword123 40 | 41 | 42 | On mgmt server (CentOS7): 43 | # ssh into mgmt server and fix hostname, /etc/hosts etc. 44 | # fix issues with marvin pkgs 45 | yum remove -y python-netaddr 46 | pip uninstall cryptography 47 | 48 | # fix cloudsack repo? 49 | yum install -y cloudstack-agent cloudstack-management cloudstack-usage cloudstack-common cloudstack-integration-tests cloudstack-marvin 50 | systemctl enable --now mariadb 51 | cloudstack-setup-databases cloud:cloud@localhost --deploy-as=root: -i $(ip route get 8.8.8.8 | head -1 | awk '{print $7}') 52 | mysql -u root --execute="INSERT INTO cloud.configuration (category, instance, component, name, value) VALUES ('Advanced', 'DEFAULT', 'management-server', 'integration.api.port', '8096');" 53 | cloudstack-setup-management 54 | # copy marvin cfg here 55 | python /usr/lib/python2.7/site-packages/marvin/deployDataCenter.py -i vmware.marvin.cfg #cfg here 56 | # run tests 57 | 58 | 59 | vmware 7.0 -> vmxnet3 60 | older can use e1000 61 | 62 | -------------------------------------------------------------------------------- /files/systemvm-map.json: -------------------------------------------------------------------------------- 1 | { 2 | "4.11": { 3 | "kvm": { 4 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-kvm.qcow2.bz2", 5 | "checksum": "d40bce40b2d5bb4ba73e56d1e95aeae5" 6 | }, 7 | "xen": { 8 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-xen.vhd.bz2", 9 | "checksum": "1566dcbcc3806755d0012d1619bd4210" 10 | }, 11 | "vmw": { 12 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-vmware.ova", 13 | "checksum": "d695376be20929d323adfaa5410c093f" 14 | } 15 | }, 16 | "4.12": { 17 | "kvm": { 18 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-kvm.qcow2.bz2", 19 | "checksum": "d40bce40b2d5bb4ba73e56d1e95aeae5" 20 | }, 21 | "xen": { 22 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-xen.vhd.bz2", 23 | "checksum": "1566dcbcc3806755d0012d1619bd4210" 24 | }, 25 | "vmw": { 26 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-vmware.ova", 27 | "checksum": "d695376be20929d323adfaa5410c093f" 28 | } 29 | }, 30 | "4.13": { 31 | "kvm": { 32 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-kvm.qcow2.bz2", 33 | "checksum": "d40bce40b2d5bb4ba73e56d1e95aeae5" 34 | }, 35 | "xen": { 36 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-xen.vhd.bz2", 37 | "checksum": "1566dcbcc3806755d0012d1619bd4210" 38 | }, 39 | "vmw": { 40 | "url": "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.3-vmware.ova", 41 | "checksum": "d695376be20929d323adfaa5410c093f" 42 | } 43 | }, 44 | "4.14": { 45 | "kvm": { 46 | "url": "https://download.cloudstack.org/systemvm/4.14/systemvmtemplate-4.14.0-kvm.qcow2.bz2", 47 | "checksum": "4978e6e6140d167556f201496549a498" 48 | }, 49 | "xen": { 50 | "url": "https://download.cloudstack.org/systemvm/4.14/systemvmtemplate-4.14.0-xen.vhd.bz2", 51 | "checksum": "2e3078de2ccce760d537e06fd9b4c7c7" 52 | }, 53 | "vmw": { 54 | "url": "https://download.cloudstack.org/systemvm/4.14/systemvmtemplate-4.14.0-vmware.ova", 55 | "checksum": "33cad72f858aef11c95df486b0f21938" 56 | } 57 | }, 58 | "4.15": { 59 | "kvm": { 60 | "url": "https://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-kvm.qcow2.bz2", 61 | "checksum": "0e9f9a7d0957c3e0a2088e41b2da2cec" 62 | }, 63 | "xen": { 64 | "url": "https://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-xen.vhd.bz2", 65 | "checksum": "86373992740b1eca8aff8b08ebf3aea5" 66 | }, 67 | "vmw": { 68 | "url": "https://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-vmware.ova", 69 | "checksum": "4006982765846d373eb3719b2fe4d720" 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /doc/centos7.md: -------------------------------------------------------------------------------- 1 | [root@localhost yum.repos.d]# cat /etc/yum.repos.d/cloudstack.repo 2 | [cloudstack] 3 | name=cloudstack 4 | baseurl=http://download.cloudstack.org/el/8/4.17/ 5 | enabled=1 6 | gpgcheck=0 7 | 8 | [root@localhost ~]# yum deplist cloudstack-management cloudstack-common cloudstack-usage cloudstack-cli | awk '/provider:/ {print $2}' | sort -u | grep -v java | grep -v cloudstack | xargs yum install -y 9 | 10 | hostnamectl set-hostname localhost --transient 11 | 12 | [root@localhost ~]# iptables-restore < /etc/sysconfig/iptables 13 | iptables -F ? 14 | 15 | [root@localhost ~]# systemctl stop firewalld 16 | [root@localhost ~]# systemctl disable firewalld 17 | 18 | rm -fr /var/lib/mysql/* 19 | 20 | [root@localhost ~]# systemctl stop mysqld 21 | [root@localhost ~]# systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" 22 | [root@localhost ~]# systemctl start mysqld 23 | [root@localhost ~]# 24 | [root@localhost ~]# mysql -u root 25 | Welcome to the MySQL monitor. Commands end with ; or \g. 26 | Your MySQL connection id is 2 27 | Server version: 5.7.32-log MySQL Community Server (GPL) 28 | 29 | Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. 30 | 31 | Oracle is a registered trademark of Oracle Corporation and/or its 32 | affiliates. Other names may be trademarks of their respective 33 | owners. 34 | 35 | Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 36 | 37 | mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssword123'; 38 | ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement 39 | mysql> flush privileges; 40 | Query OK, 0 rows affected (0.07 sec) 41 | 42 | mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'P@ssword123'; 43 | Query OK, 0 rows affected (0.06 sec) 44 | 45 | mysql> flush privileges; 46 | Query OK, 0 rows affected (0.02 sec) 47 | 48 | mysql> ^DBye 49 | 50 | 51 | [root@localhost ~]# systemctl stop mysqld 52 | 53 | [root@localhost ~]# 54 | [root@localhost ~]# systemctl unset-environment MYSQLD_OPTS 55 | [root@localhost ~]# systemctl start mysqld 56 | [root@localhost ~]# mysql -u root 57 | ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 58 | [root@localhost ~]# mysql -u root -p 59 | Enter password: 60 | Welcome to the MySQL monitor 61 | 62 | 63 | In /etc/my.cnf: 64 | server-id=1 65 | sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION" 66 | binlog-format = 'ROW' 67 | log-bin=mysql-bin 68 | max_connections=700 69 | innodb_lock_wait_timeout=600 70 | innodb_rollback_on_timeout=1 71 | datadir=/var/lib/mysql 72 | 73 | mysql> SHOW VARIABLES LIKE 'validate_password%'; 74 | mysql> SET GLOBAL validate_password_length = 5; 75 | mysql> set global validate_password_number_count = 0; 76 | mysql> set global validate_password_mixed_case_count = 0; 77 | Query OK, 0 rows affected (0.00 sec) 78 | 79 | mysql> set global validate_password_special_char_count = 0; 80 | Query OK, 0 rows affected (0.00 sec) 81 | 82 | mysql> set validate_password_policy = 'LOW'; 83 | ERROR 1229 (HY000): Variable 'validate_password_policy' is a GLOBAL variable and should be set with SET GLOBAL 84 | mysql> set global validate_password_policy = 'LOW'; 85 | Query OK, 0 rows affected (0.00 sec) 86 | -------------------------------------------------------------------------------- /files/result.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | import os 19 | import argparse 20 | 21 | import lxml.etree 22 | from operator import itemgetter 23 | 24 | def main(): 25 | args = _generate_args() 26 | file_path_list = _generate_file_list(args) 27 | 28 | exit(parse_reports(file_path_list)) 29 | 30 | def _generate_args(): 31 | parser = argparse.ArgumentParser( 32 | description='Command line utility for reading xunit xml files' 33 | ) 34 | 35 | parser.add_argument( 36 | 'path', 37 | metavar='/path/to/folder/containing/xunit-reports', 38 | type=str, 39 | help='A path to a folder containing xunit reports' 40 | ) 41 | args = parser.parse_args() 42 | return vars(args) 43 | 44 | def _generate_file_list(args): 45 | path = args.pop('path') 46 | file_path_list = [] 47 | if path.endswith('.xml') and os.path.isfile(path): 48 | file_path_list.append(path) 49 | for (root, dirnames, filenames) in os.walk(path): 50 | for filename in filenames: 51 | if filename.endswith('.xml'): 52 | file_path_list.append(os.path.join(root, filename)) 53 | 54 | return file_path_list 55 | 56 | def parse_reports(file_path_list): 57 | print("Only failed tests shown:") 58 | print("Test | Result | Time (s) | Test File") 59 | print("--- | --- | --- | ---") 60 | 61 | exit_code = 0 62 | 63 | tests = [] 64 | for file_path in file_path_list: 65 | filename = file_path[file_path.find('test_'):].replace('.xml', '') 66 | data = lxml.etree.iterparse(file_path, tag='testcase') 67 | for event, elem in data: 68 | name = '' 69 | status = 'Success' 70 | time = '' 71 | if 'name' in elem.attrib: 72 | name = elem.attrib['name'] 73 | if 'time' in elem.attrib: 74 | time = str(elem.attrib['time']) 75 | for children in elem.getchildren(): 76 | if 'skipped' == children.tag: 77 | status = 'Skipped' 78 | elif 'failure' == children.tag: 79 | exit_code = 1 80 | status = '`Failure`' 81 | elif 'error' == children.tag: 82 | exit_code = 1 83 | status = '`Error`' 84 | if status not in ['Success', 'Skipped']: 85 | tests.append([name, status, time, filename]) 86 | 87 | for test in tests: 88 | print("%s | %s | %s | %s" % (test[0], test[1], test[2], test[3])) 89 | print("") 90 | return exit_code 91 | 92 | if __name__ == "__main__": 93 | main() 94 | -------------------------------------------------------------------------------- /templates/xmls/mbxt-kvm-el7.xml: -------------------------------------------------------------------------------- 1 | 2 | mbxt-kvm-el7 3 | 942496ef-dfb1-4bcd-9751-93d3a02c35a7 4 | 8388608 5 | 8388608 6 | 4 7 | 8 | hvm 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | destroy 22 | restart 23 | destroy 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | 36 |
37 | 38 | 39 | 40 |
41 | 42 | 43 | 44 |
45 | 46 | 47 | 48 |
49 | 50 | 51 | 52 |
53 | 54 | 55 |
56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 | 82 |