Port gathering logs routine from .functests to post ansible yaml
Change-Id: I5cc87cac7eb2a36b8c86a4807592d3ee64d94780
This commit is contained in:
parent
cda48e29ca
commit
28677c0113
16
.functests
16
.functests
@ -23,19 +23,3 @@ if [ "$FLAVOR" == "jenkins" ]; then
|
||||
else
|
||||
nosetests --exe -v -a '!slow' ${@:2}
|
||||
fi
|
||||
rvalue=$?
|
||||
|
||||
cd -
|
||||
# dump log into VIRTUAL_ENV_DIR when this func test call via tox
|
||||
if [ ! -z "${VIRTUAL_ENV+x}" ]; then
|
||||
log_dir="${VIRTUAL_ENV}/logs"
|
||||
mkdir -p ${log_dir}
|
||||
for log_name in "account-server" "container-server" "object-server" "proxy-server" "ansible" "storlets-daemon" "daemon-factory"; do
|
||||
log_file="${log_dir}/${log_name}.log"
|
||||
echo "grep syslog from /var/log/syslog to ${log_file}"
|
||||
sudo egrep "${log_name}" /var/log/syslog > ${log_file}
|
||||
sudo chown ${USER}.${USER} ${log_file}
|
||||
done
|
||||
fi
|
||||
|
||||
exit $rvalue
|
||||
|
@ -1,10 +1,41 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Create log directory to pull
|
||||
file:
|
||||
path: '{{ zuul.project.src_dir }}/logs'
|
||||
state: directory
|
||||
|
||||
- name: Prepare the logs into user space
|
||||
shell: "egrep {{ item }} /var/log/syslog > {{ zuul.project.src_dir }}/logs/{{ item }}.log"
|
||||
with_items:
|
||||
- "account-server"
|
||||
- "container-server"
|
||||
- "object-server"
|
||||
- "proxy-server"
|
||||
- "ansible"
|
||||
- "storlets-daemon"
|
||||
- "daemon-factory"
|
||||
become: yes
|
||||
|
||||
- name: Change log permisson as readable
|
||||
file:
|
||||
path: "{{ zuul.project.src_dir }}/logs/{{ item }}.log"
|
||||
mode: 0644
|
||||
with_items:
|
||||
- "account-server"
|
||||
- "container-server"
|
||||
- "object-server"
|
||||
- "proxy-server"
|
||||
- "ansible"
|
||||
- "storlets-daemon"
|
||||
- "daemon-factory"
|
||||
become: yes
|
||||
|
||||
- name: Copy logs from worker nodes to executor node
|
||||
synchronize:
|
||||
# TODO: make it sort of tox_envdir
|
||||
src: '{{ zuul.project.src_dir }}/.tox/func-py3/logs'
|
||||
src: '{{ zuul.project.src_dir }}/logs'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
copy_links: true
|
||||
|
@ -1,10 +1,40 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Create log directory to pull
|
||||
file:
|
||||
path: '{{ zuul.project.src_dir }}/logs'
|
||||
state: directory
|
||||
|
||||
- name: Prepare the logs into user space
|
||||
shell: "egrep {{ item }} /var/log/syslog > {{ zuul.project.src_dir }}/logs/{{ item }}.log"
|
||||
with_items:
|
||||
- "account-server"
|
||||
- "container-server"
|
||||
- "object-server"
|
||||
- "proxy-server"
|
||||
- "ansible"
|
||||
- "storlets-daemon"
|
||||
- "daemon-factory"
|
||||
become: yes
|
||||
|
||||
- name: Change log permisson as readable
|
||||
file:
|
||||
path: "{{ zuul.project.src_dir }}/logs/{{ item }}.log"
|
||||
mode: 0644
|
||||
with_items:
|
||||
- "account-server"
|
||||
- "container-server"
|
||||
- "object-server"
|
||||
- "proxy-server"
|
||||
- "ansible"
|
||||
- "storlets-daemon"
|
||||
- "daemon-factory"
|
||||
|
||||
- name: Copy logs from worker nodes to executor node
|
||||
synchronize:
|
||||
# TODO: make it sort of tox_envdir
|
||||
src: '{{ zuul.project.src_dir }}/.tox/func/logs'
|
||||
src: '{{ zuul.project.src_dir }}/logs'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
copy_links: true
|
||||
|
Loading…
Reference in New Issue
Block a user