./download_images.sh
```
2. Add the corresponding VIM target to your OSM (`osm vim-create ...`).
- 3. Copy all packages (NF, NS, NSI) required for the tests to the `packages/` folder. Hint:
- ```bash
- cd packages
- ./download_packages.sh
- ```
2. Provide credentials for your VIM+OSM environment:
- Create/Edit `localconfig/envconfig.rc` (and `localconfig/envprovisioning.sh` if needed).
- HINT: First time, use `localconfig/TEMPLATE-envconfig.rc` and (if needed) `localconfig/TEMPLATE-envprovisioning.sh` as templates.
robot -d /vagrant/results testsuite/hackfest_basic.robot
```
+**TIP:** In case your needed to use the latest version of OSM client from master instead of the latest stable version, simply do:
+
+```bash
+export OSM_CLIENT_VERSION=master
+vagrant up
+```
+
+**Please use this option with caution, and only when absolutely required**.
+
## INTRODUCTION
This Vagrant sandbox provides a simple self-contained environment suitable for running consistently E2E tests with OSM.
- `envprovisioning.sh`, where local provisioning tasks are scripted. This file is optional.
- `envconfig.rc`, where the DUT (VIM and OSM) are defined with environment variables.
- All packages required for the tests are already placed at `${PACKAGES_FOLDER}`.
- - In Vagrant, `/vagrant/packages`.
+ - In Vagrant, they are cloned into `/home/vagrant/packages/osm-packages` in the VM.
- All images required for the tests are already placed at `${IMAGES_FOLDER}`.
- In Vagrant, `/vagrant/images`.
- This folder is intended for future use, but not relevant for the current test suite.
# Folder to save alternative DUT environments (optional)
export ENVIRONMENTS_FOLDER=environments
# Folder where all required packages are stored
-export PACKAGES_FOLDER="/vagrant/packages"
+export BASE_PACKAGES_FOLDER="${BASE_FOLDER}/packages"
+export PACKAGES_FOLDER="${BASE_PACKAGES_FOLDER}/osm-packages"
# Folder where all required images are stored (intended for future use)
#export IMAGES_FOLDER="/vagrant/images"
# Folder where test results should be exported
exit 1
fi
+mkdir -p ${BASE_PACKAGES_FOLDER} # Folder to store collections of packages, based on env varibles
+
# (OPTIONAL) Devops patch configuration
if [ -f ${BASE_CONFIG_FOLDER}/patchconfig.rc ]
then
#------------------------------------------------------------------------------------------------------
# Installs OSM client
+if [ -n "${1}" ]; then # If there is a first argument, it must be the version
+ OSM_VERSION=$1
+fi
+
sudo sed -i "/osm-download.etsi.org/d" /etc/apt/sources.list
wget -qO - https://osm-download.etsi.org/repository/osm/debian/ReleaseSEVEN/OSM%20ETSI%20Release%20Key.gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://osm-download.etsi.org/repository/osm/debian/ReleaseSEVEN stable devops IM osmclient"
sudo -H python3 -m pip install python-magic pyangbind verboselogs
sudo apt-get install -y python3-osmclient
+# Checks if there is is a version indication and if it is for "master"
+if [[ -n "${OSM_VERSION}" && "${OSM_VERSION}" = "master" ]]
+then
+ sudo apt-get remove -y python3-osmclient
+ sudo apt-get install python3-pip libcurl4-openssl-dev libssl-dev
+
+ # Upgrade pip and install dependencies (python-magic, osm-im)
+ # Next instructions install the dependencies at system level with sudo -H
+ sudo -H python3 -m pip install -U pip
+ sudo -H python3 -m pip install python-magic
+ sudo -H python3 -m pip install git+https://osm.etsi.org/gerrit/osm/IM --upgrade
+
+ # Clone the osmclient repo and install OSM client from the git repo.
+ git clone https://osm.etsi.org/gerrit/osm/osmclient
+ curl -Lo osmclient/.git/hooks/commit-msg http://osm.etsi.org/gerrit/tools/hooks/commit-msg
+ chmod u+x osmclient/.git/hooks/commit-msg
+ # Install osmclient using pip3 with the --user and -e options
+ python3 -m pip install --user -e osmclient
+fi
+
# Installs OpenStack client
##For Train version, uncomment the following two lines:
##sudo add-apt-repository -y cloud-archive:train
##sudo apt-get update
sudo apt-get install -y python3-openstackclient # Installs Queens by default
-# Installs Robot and all dependencies required for the tests
+# Downloads community test plan
+ssh-keyscan -p 29419 osm.etsi.org >> ~/.ssh/known_hosts
+git clone ssh://git@osm.etsi.org:29419/osm-doc/osm-tester-guide.git
+# Downloads community packages and puts them in the location determined by the corresponding env variable for Robot
+git clone ssh://git@osm.etsi.org:29419/vnf-onboarding/osm-packages.git ${PACKAGES_FOLDER}
+
+# Installs Robot and all dependencies required for the tests
sudo -H python3 -m pip install --ignore-installed haikunator requests pyvcloud progressbar pathlib robotframework robotframework-seleniumlibrary robotframework-requests robotframework-SSHLibrary
curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main"
# Installs some additional packages to ease interactive troubleshooting
sudo apt-get install -y osm-devops
sudo snap install charm --classic
+sudo apt-get install -y jq
sudo snap install yq
# Copies VIM credentials in `clouds.yaml` (if applicable) to a proper location