-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathvm_remote_trigger_script.sh
executable file
·69 lines (50 loc) · 2 KB
/
vm_remote_trigger_script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Illegal number of parameters; Please provide the filesystem as the parameter;"
exit 1
fi
fs=$1
# If xfsMonkey is already running, skip running again
num=`ps aux | grep xfsMonkey | grep -v grep | wc -l`
if [ $num -ne 0 ]
then
echo `date` 'xfsMonkey is already running.. Skipping the triggering of xfsMonkey.. '
exit
fi
num=`ps aux | grep vm_remote_trigger_script | grep -v grep | wc -l`
if [ $num -gt 3 ]
then
echo `date` 'trigger script might already be running (check the processes below).. Skipping the triggering of xfsMonkey.. '
ps aux | grep vm_remote_trigger_script
exit
fi
# install libattr for xattr headers
echo `date` 'Installing libattr1-dev..'
echo password | sudo -S apt-get install --yes libattr1-dev btrfs-tools f2fs-tools xfsprogs
# update crashmonkey repo
echo `date` 'Updating crashmonkey repo..'
cd projects/crashmonkey
echo password | sudo -S git checkout .
echo password | sudo -S git pull
echo password | sudo -S git checkout master
echo `date` 'Removing log files..'
echo password | sudo -S rm *.log
echo password | sudo -S rm build/*.log
echo password | sudo -S rm diff_results/*
# Do cm cleanup -> rm cow_brd, disk_wrapper, umount etc
echo password | sudo -S bash /home/user/cm_cleanup.sh
echo `date` 'Creating /mnt/snapshot..'
echo password | sudo -S mkdir -p /mnt/snapshot
echo password | sudo -S rm code/tests/j-lang*.cpp
echo password | sudo -S rm build/tests/j-lang*.so
echo `date` 'Copying cpp workload files to code/tests/..'
cp ~/seq2/* code/tests/
echo `date` 'Compiling..'
make
echo `date` 'Moving built so files to xfsMonkeyTests/..'
echo password | sudo -S rm -r build/xfsMonkeyTests
echo password | sudo -S mkdir -p build/xfsMonkeyTests
echo password | sudo -S mv build/tests/j-lang*.so build/xfsMonkeyTests/
echo `date` 'Triggering xfsMonkey run..'
nohup echo password | sudo -S python xfsMonkey.py -f /dev/sda -d /dev/cow_ram0 -t $fs -e 102400 > xfsmonkey_seq2_"$fs"_run1.log &
echo `date` 'Triggered.'