Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117879517
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/deployments/ansible/roles/kolab-test/files/activesyncload.sh b/deployments/ansible/roles/kolab-test/files/activesyncload.sh
index c7d5a12..03c1666 100644
--- a/deployments/ansible/roles/kolab-test/files/activesyncload.sh
+++ b/deployments/ansible/roles/kolab-test/files/activesyncload.sh
@@ -1,31 +1,35 @@
#!/bin/bash
DEFAULT_TAG="latest"
if [ "$(uname -m)" == "ppc64le" ]; then
DEFAULT_TAG="latest-linux-ppc64le"
fi
export TAG=${TAG:-${DEFAULT_TAG}}
count="$1"
-user="$2"
-password="$3"
+clientprefix="$2"
+user="$3"
+password="$4"
+folder="$5"
if [ "$user" == "" ]; then
user="admin@{{ domain }}"
password='{{ admin_password }}'
fi
export user
export password
+export folder
+export clientprefix
function cleanup {
- podman kill $(podman ps -q -f name=loadtest)
+ podman kill $(podman ps -q -f name=activesyncload$clientprefix)
}
trap cleanup EXIT
loadActivesync() {
- podman run --rm --name loadtest$1 -ti "quay.io/apheleiait/kolab/utils:$TAG" bash -c "while true; do ./activesynccli.py --host {{ domain }} --user "$user" --password "$password" --deviceid device$1 sync INBOX ; done"
+ podman run --rm --name "activesyncload${clientprefix}${1}" -ti "quay.io/apheleiait/kolab/utils:$TAG" bash -c "while true; do ./activesynccli.py --host {{ domain }} --user '$user' --password '$password' --deviceid "${clientprefix}${1}" sync $folder ; done"
}
export -f loadActivesync
parallel --jobs 0 loadActivesync ::: $(seq 1 $count)
diff --git a/deployments/ansible/roles/kolab-test/files/load.sh b/deployments/ansible/roles/kolab-test/files/load.sh
new file mode 100644
index 0000000..7deff5f
--- /dev/null
+++ b/deployments/ansible/roles/kolab-test/files/load.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+function cleanup {
+ for job in $(jobs -p)
+ do
+ kill "$job"
+ done
+}
+trap cleanup EXIT
+
+./activesyncload.sh 45 client1- "admin@{{ domain }}" "{{ admin_password }}" INBOX &
+# TODO add other types of load
+# ./activesyncload.sh 20 client2- test1@... simple123 INBOX &
+# ./activesyncload.sh 20 client3- test1@... simple123 Calendar &
+
+echo "All workloads are started"
+wait
diff --git a/deployments/ansible/roles/kolab-test/tasks/main.yaml b/deployments/ansible/roles/kolab-test/tasks/main.yaml
index 64fb0ee..be331cf 100644
--- a/deployments/ansible/roles/kolab-test/tasks/main.yaml
+++ b/deployments/ansible/roles/kolab-test/tasks/main.yaml
@@ -1,67 +1,72 @@
---
- name: Add a host alias so we can connect to the discovered vm ip
ansible.builtin.add_host:
hostname: '{{ inventory_hostname }}'
ansible_host: '{{ vm_ip.stdout }}'
- name: Install podman
ansible.builtin.command: dnf -y install podman
- name: Enable CRB
ansible.builtin.command: dnf config-manager --set-enabled crb
- name: Install EPEL
ansible.builtin.command: dnf -y install epel-release
- name: Install parallel
ansible.builtin.command: dnf -y install parallel
- ansible.builtin.command: podman pull quay.io/apheleiait/kolab/utils
- name: Test ssh connection and update default password
block:
- ansible.builtin.set_fact:
ansible_ssh_pass: "{{ vm_root_password }}"
- wait_for_connection:
timeout: 3
rescue:
- ansible.builtin.set_fact:
ansible_ssh_pass: "{{ vm_current_password }}"
- name: Assert that this is a kolab vm system, otherwise fail
ansible.builtin.command: grep KOLABBOOTSTRAP /etc/profile.d/sh.local
- name: Change root password
ansible.builtin.user:
name: root
password: "{{ vm_root_password | password_hash }}"
always:
- ansible.builtin.set_fact:
ansible_ssh_pass: "{{ vm_root_password }}"
- name: Assert that this is a kolab vm system, otherwise fail
ansible.builtin.command: grep KOLABBOOTSTRAP /etc/profile.d/sh.local
- name: ssh authorized keys
ansible.builtin.template:
src: files/authorized_keys.j2
dest: /root/.ssh/authorized_keys
owner: root
group: root
mode: '0600'
# TODO fallback to single host ip
- name: add /etc/hosts entry for virtual ip
lineinfile:
dest: /etc/hosts
regexp: '.*{{ domain }}$'
line: "{{ virtual_ip }} {{ domain }}"
state: present
- ansible.builtin.template:
src: files/activesyncload.sh
dest: /root/
mode: '0744'
+- ansible.builtin.template:
+ src: files/load.sh
+ dest: /root/
+ mode: '0744'
+
- ansible.builtin.template:
src: files/mailsendtest.sh
dest: /root/
mode: '0744'
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Apr 5, 11:00 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18828324
Default Alt Text
(4 KB)
Attached To
Mode
R114 kolab-infrastructure
Attached
Detach File
Event Timeline