<commit_before>#!/bin/bash

cd ../../orchestrator/commands/

python ./createNewService.py http               \
                                 localhost      \
                                 5000           \
                                 admin_domain   \
                                 cloud_admin    \
                                 password       \
                                 SmartCity      \
                                 smartcity      \
                                 adm1           \
                                 password       \
                                 http           \
                                 localhost      \
                                 8080

python ./assignInheritRoleServiceUser.py http        \
                                    localhost        \
                                    5000             \
                                    SmartCity    \
                                    adm1             \
                                    password         \
                                    adm1             \
                                    SubServiceAdmin  \
                                    http             \
                                    localhost        \
                                    8080

python ./createNewSubService.py  http                \
                                      localhost      \
                                      5000           \
                                      SmartCity  \
                                      adm1           \
                                      password       \
                                      Electricidad   \
                                      electricidad

python ./createNewServiceUser.py  http               \
                                      localhost      \
                                      5000           \
                                      SmartCity  \
                                      adm1           \
                                      password       \
                                      Alice          \
                                      password

python ./assignRoleSubServiceUser.py http             \
                                       localhost      \
                                       5000           \
                                       SmartCity  \
                                       Electricidad   \
                                       adm1           \
                                       password       \
                                       SubServiceAdmin\
                                       Alice

python ./createNewSubService.py  http                \
                                      localhost      \
                                      5000           \
                                      SmartCity  \
                                      adm1           \
                                      password       \
                                      Basuras        \
                                      basuras

python ./createNewServiceUser.py  http                \
                                       localhost      \
                                       5000           \
                                       SmartCity  \
                                       adm1           \
                                       password       \
                                       bob            \
                                       password

python ./assignRoleSubServiceUser.py http             \
                                       localhost      \
                                       5000           \
                                       SmartCity  \
                                       Basuras        \
                                       adm1           \
                                       password       \
                                       SubServiceAdmin\
                                       bob

python ./createNewServiceUser.py  http               \
                                      localhost      \
                                      5000           \
                                      SmartCity  \
                                      adm1           \
                                      password       \
                                      Carl           \
                                      password

python ./createNewServiceRole.py  http               \
                                      localhost      \
                                      5000           \
                                      SmartCity  \
                                      adm1           \
                                      password       \
                                      ServiceCustomer\
                                      http           \
                                      localhost      \
                                      8080

python ./assignRoleServiceUser.py http                \
                                       localhost      \
                                       5000           \
                                       SmartCity  \
                                       adm1           \
                                       password       \
                                       ServiceCustomer\
                                       Carl

python ./assignInheritRoleServiceUser.py http         \
                                    localhost         \
                                    5000              \
                                    SmartCity     \
                                    adm1              \
                                    password          \
                                    Carl              \
                                    SubServiceCustomer


cd -
<commit_msg>add checks in each step of provision scenario script<commit_after>#!/bin/bash

KEYSTONE_PROTOCOL=http
KEYSTONE_HOST=localhost
KEYSTONE_PORT=5000
KEYPASS_PROTOCOL=http
KEYPASS_HOST=localhost
KEYPASS_PORT=8080


function checkResult() {
  RESULT=$(( ! $1 && $RESULT ))

  if [ $RESULT -eq 1 ]; then
    echo -e "\t- $2 .............................. OK"
  else
    echo -e "Error found while $2. Code: $1. Aborting"
    exit $RESULT
  fi
}

cd ../../orchestrator/commands/

python ./createNewService.py $KEYSTONE_PROTOCOL \
                                 $KEYSTONE_HOST \
                                 $KEYSTONE_PORT \
                                 admin_domain   \
                                 cloud_admin    \
                                 password       \
                                 SmartCity      \
                                 smartcity      \
                                 adm1           \
                                 password       \
                                 $KEYPASS_PROTOCOL  \
                                 $KEYPASS_HOST  \
                                 $KEYPASS_PORT
checkResult $? "Creating service"

python ./assignInheritRoleServiceUser.py $KEYSTONE_PROTOCOL \
                                    $KEYSTONE_HOST   \
                                    $KEYSTONE_PORT   \
                                    SmartCity        \
                                    adm1             \
                                    password         \
                                    adm1             \
                                    SubServiceAdmin  \
                                    $KEYPASS_PROTOCOL\
                                    $KEYPASS_HOST    \
                                    $KEYPASS_PORT
checkResult $? "assignInheritRole to admin"

python ./createNewSubService.py  $KEYSTONE_PROTOCOL  \
                                      $KEYSTONE_HOST \
                                      $KEYSTONE_PORT \
                                      SmartCity      \
                                      adm1           \
                                      password       \
                                      Electricidad   \
                                      electricidad
checkResult $? "Creating sub service Electricidad"

python ./createNewServiceUser.py  $KEYSTONE_PROTOCOL \
                                      $KEYSTONE_HOST \
                                      $KEYSTONE_PORT \
                                      SmartCity      \
                                      adm1           \
                                      password       \
                                      Alice          \
                                      password
checkResult $? "Creating user Alice"

python ./assignRoleSubServiceUser.py $KEYSTONE_PROTOCOL  \
                                       $KEYSTONE_HOST \
                                       $KEYSTONE_PORT \
                                       SmartCity      \
                                       Electricidad   \
                                       adm1           \
                                       password       \
                                       SubServiceAdmin\
                                       Alice
checkResult $? "Assing role SubServiceAdmin to user Alice"

python ./createNewSubService.py  $KEYSTONE_PROTOCOL  \
                                      $KEYSTONE_HOST \
                                      $KEYSTONE_PORT \
                                      SmartCity      \
                                      adm1           \
                                      password       \
                                      Basuras        \
                                      basuras
checkResult $? "Creating subservice Basuras"

python ./createNewServiceUser.py  $KEYSTONE_PROTOCOL  \
                                       $KEYSTONE_HOST \
                                       $KEYSTONE_PORT \
                                       SmartCity      \
                                       adm1           \
                                       password       \
                                       bob            \
                                       password
checkResult $? "Creating user bob"

python ./assignRoleSubServiceUser.py $KEYSTONE_PROTOCOL  \
                                       $KEYSTONE_HOST \
                                       $KEYSTONE_PORT \
                                       SmartCity      \
                                       Basuras        \
                                       adm1           \
                                       password       \
                                       SubServiceAdmin\
                                       bob
checkResult $? "Assign subServiceAdmin role to user bob"

python ./createNewServiceUser.py  $KEYSTONE_PROTOCOL \
                                      $KEYSTONE_HOST \
                                      $KEYSTONE_PORT \
                                      SmartCity      \
                                      adm1           \
                                      password       \
                                      Carl           \
                                      password
checkResult $? "Creating user Carl"

python ./createNewServiceRole.py  $KEYSTONE_PROTOCOL \
                                      $KEYSTONE_HOST \
                                      $KEYSTONE_PORT \
                                      SmartCity      \
                                      adm1           \
                                      password       \
                                      ServiceCustomer\
                                      $KEYSTONE_PROTOCOL  \
                                      $KEYSTONE_HOST \
                                      $KEYPASS_PORT
checkResult $? "creating new ServiceCustomer role"

python ./assignRoleServiceUser.py $KEYSTONE_PROTOCOL  \
                                       $KEYSTONE_HOST \
                                       $KEYSTONE_PORT \
                                       SmartCity      \
                                       adm1           \
                                       password       \
                                       ServiceCustomer\
                                       Carl
checkResult $? "Assign ServiceCustomer role to user Carl"

python ./assignInheritRoleServiceUser.py $KEYSTONE_PROTOCOL \
                                    $KEYSTONE_HOST    \
                                    $KEYSTONE_PORT    \
                                    SmartCity         \
                                    adm1              \
                                    password          \
                                    Carl              \
                                    SubServiceCustomer
checkResult $? "Assign subServiceCustomer role to user Carl"

cd -

{'fraction_non_alphanumeric': 0.03602474743519461, 'fraction_numerical': 0.00775315216540058, 'mean_word_length': 0.3845820232028624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 239, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3737192', 'n_tokens_mistral': 2328, 'n_tokens_neox': 2096, 'n_words': 375}