Step 2: Move test folder to root
[integration/test.git] / tools / tools_vm / scripts / fedora.sh
1 #!/usr/bin/env bash
2
3 # --------------------------------------------
4 # External shell provisioner script for Fedora
5 # --------------------------------------------
6 echo "Preparing basic environnement"
7
8 # Set HOME variable for this script
9 HOME="/home/vagrant"
10
11 # Add a nice login message
12 su -c "cp /vagrant/scripts/welcome.txt /etc/motd"
13
14 # Install initial packages
15 su -c "yum install -y \
16   git \
17   puppet \
18   python-pip \
19   python-devel"
20
21 # ----------------
22 # Install netopeer
23 # ----------------
24 echo "Installing netopeer"
25
26 # Install required dependencies
27 su -c "yum install -y \
28   readline \
29   readline-devel \
30   libssh2 \
31   libssh2-devel \
32   libxml2 \
33   libxml2-devel \
34   libxml2-python \
35   libxslt \
36   libxslt-devel \
37   libcurl \
38   libcurl-devel \
39   dbus \
40   dbus-devel \
41   libevent \
42   libevent-devel \
43   libssh-devel \
44   libtool \
45   doxygen"
46
47 # Install pyang (extensible YANG validator and converter in python)
48 cd $HOME && \
49   git clone https://github.com/mbj4668/pyang.git && \
50   su -c "chown -R vagrant:vagrant $HOME/pyang/" && \
51   cd $HOME/pyang/ && \
52   su -c "python setup.py install"
53
54 # Install libnetconf (NETCONF library in C)
55 cd $HOME && \
56   git clone https://github.com/cesnet/libnetconf && \
57   su -c "chown -R vagrant:vagrant $HOME/libnetconf/" && \
58   cd $HOME/libnetconf/ && \
59   sh configure --prefix=/usr --with-nacm-recovery-uid=1000 && \
60   make && \
61   su -c "make install"
62
63 # Install netopeer (set of NETCONF tools built on the libnetconf library)
64 cd $HOME && \
65   git clone https://github.com/cesnet/netopeer && \
66   su -c "chown -R vagrant:vagrant $HOME/netopeer/" && \
67   cd $HOME/netopeer/server/ && \
68   sh configure --prefix=/usr && \
69   make && \
70   su -c "make install"
71
72 # --------------------------------
73 # Install Robot Framework and RIDE
74 # --------------------------------
75 echo "Installing Robot Framework and RIDE"
76
77 # Install required dependencies
78 su -c "yum install -y \
79   wxGTK-devel \
80   gcc-c++ \
81   xorg-x11-xauth"
82
83 # Install Robot Framework libraries
84 su -c "pip install \
85   robotframework-ride \
86   robotframework-sshlibrary \
87   robotframework-requests"
88
89 # Install wxPython, a blending of the wxWidgets C++ class library used for RIDE
90 cd $HOME && \
91   wget -e dotbytes=1M http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/wxPython-src-2.8.12.1.tar.bz2 && \
92   tar -xvjf wxPython-src-2.8.12.1.tar.bz2 && \
93   rm wxPython-src-2.8.12.1.tar.bz2 && \
94   cd wxPython-src-2.8.12.1/wxPython && \
95   python setup.py build && \
96   su -c "python setup.py install"
97
98 # ----------------------------
99 # Add aliases to run the tools
100 # ----------------------------
101 echo "Creating aliases"
102
103 # Add 'ride' alias for quietly running RIDE gui
104 echo "alias ride=\"nohup ride.py >/dev/null 2>&1 &\"" >> $HOME/.bashrc
105
106 # Add 'karaf' alias for running karaf shell
107 echo "alias karaf=\"sh /vagrant/scripts/connect.sh\"" >> $HOME/.bashrc