summaryrefslogtreecommitdiffstats
path: root/src/test/behave_tests/template
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/behave_tests/template')
-rw-r--r--src/test/behave_tests/template/bootstrap_script_template30
-rw-r--r--src/test/behave_tests/template/kcli_plan_template41
2 files changed, 71 insertions, 0 deletions
diff --git a/src/test/behave_tests/template/bootstrap_script_template b/src/test/behave_tests/template/bootstrap_script_template
new file mode 100644
index 000000000..de2129e76
--- /dev/null
+++ b/src/test/behave_tests/template/bootstrap_script_template
@@ -0,0 +1,30 @@
+export PATH=/root/bin:$PATH
+mkdir /root/bin
+
+CEPHADM="/root/bin/cephadm"
+
+{% raw %}
+{% if ceph_dev_folder is defined %}
+ /mnt/{{ ceph_dev_folder }}/src/cephadm/build.sh $CEPHADM
+{% else %}
+ curl --silent -o $CEPHADM --location https://raw.githubusercontent.com/ceph/ceph/main/src/cephadm/cephadm.py
+{% endif %}
+chmod +x $CEPHADM
+mkdir -p /etc/ceph
+mon_ip=$(ifconfig eth0 | grep 'inet ' | awk '{ print $2}')
+{% if ceph_dev_folder is defined %}
+ echo "ceph_dev_folder is defined"
+ $CEPHADM bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} --allow-fqdn-hostname --dashboard-password-noupdate --shared_ceph_folder /mnt/{{ ceph_dev_folder }}
+{% else %}
+echo "ceph_dev_folder is not defined"
+ $CEPHADM bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} --allow-fqdn-hostname --dashboard-password-noupdate
+{% endif %}
+fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}')
+{% for number in range(1, nodes) %}
+ ssh-copy-id -f -i /etc/ceph/ceph.pub -o StrictHostKeyChecking=no root@{{ prefix }}-node-0{{ number }}.{{ domain }}
+ $CEPHADM shell --fsid $fsid -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring ceph orch host add {{ prefix }}-node-0{{ number }}.{{ domain }}
+{% endfor %}
+{% endraw %}
+{% if configure_osd %}
+$CEPHADM shell --fsid $fsid -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring ceph orch apply osd --all-available-devices
+{% endif %}
diff --git a/src/test/behave_tests/template/kcli_plan_template b/src/test/behave_tests/template/kcli_plan_template
new file mode 100644
index 000000000..b28ee0568
--- /dev/null
+++ b/src/test/behave_tests/template/kcli_plan_template
@@ -0,0 +1,41 @@
+parameters:
+ nodes: {{ nodes }}
+ pool: default
+ network: default
+ domain: cephlab.com
+ prefix: ceph
+ numcpus: {{ numcpus }}
+ memory: {{ memory }}
+ image: {{ image }}
+ notify: false
+ admin_password: password
+ disks: {{ disks }}
+
+{% raw %}
+{% for number in range(0, nodes) %}
+{{ prefix }}-node-0{{ number }}:
+ image: {{ image }}
+ numcpus: {{ numcpus }}
+ memory: {{ memory }}
+ reserveip: true
+ reservedns: true
+ sharedkey: true
+ domain: {{ domain }}
+ nets:
+ - {{ network }}
+ disks: {{ disks }}
+ pool: {{ pool }}
+ {% if ceph_dev_folder is defined %}
+ sharedfolders: [{{ ceph_dev_folder }}]
+ {% endif %}
+ cmds:
+ - yum -y install python3 chrony lvm2 podman
+ - sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config
+ - echo "after installing the python3"
+ - setenforce 0
+ {% if number == 0 %}
+ scripts:
+ - bootstrap_cluster_dev.sh
+ {% endif %}
+{% endfor %}
+{% endraw %} \ No newline at end of file