Commit 88f62cd0 authored by Mark Beierl's avatar Mark Beierl
Browse files

Add missing NS Charm Packages

Fetched the packages from
https://osm.etsi.org/wiki/index.php/Release_SEVEN_Integration_(DEVOPS)#Feature_6298_NS_primitives


and adds them to this repository so TS
Basic 12-Ns Primitives can execute.
Signed-off-by: Mark Beierl's avatarbeierlm <mark.beierl@canonical.com>
parent 151f590c
Pipeline #66 passed with stage
in 1 minute and 25 seconds
"name": "vnf-policy"
"summary": "<Fill in summary here>"
"maintainer": "Adam Israel <Adam.Israel@maidalchini>"
"description": |
<Multi-line description here>
"tags":
# Replace "misc" with one or more whitelisted tags from this list:
# https://jujucharms.com/docs/stable/authors-charm-metadata
- "misc"
- "osm"
- "vnf"
"series":
- "xenial"
- "bionic"
- "trusty"
"subordinate": !!bool "false"
This diff is collapsed.
from charmhelpers.core.hookenv import (
action_get,
action_fail,
action_set,
status_set,
log,
)
from charms.reactive import (
clear_flag,
set_flag,
when,
when_not,
)
@when('sshproxy.configured')
@when_not('vnf-policy.installed')
def install_vnf_b():
set_flag('vnf-policy.installed')
status_set('active', 'Ready!')
@when('actions.set-policy')
def action_set_policy():
"""Set the policy for a given user.
Sets the policy (bw and qos) for the specified user_id
"""
err = ''
updated = False
try:
user_id = action_get('user_id')
bw = action_get('bw')
qos = action_get('qos')
# If this were a functional vnf, you would perform your operation here
# and may return a value to indicate success or failure.
updated = True
except Exception as err:
action_fail(str(err))
else:
action_set({'updated': updated})
finally:
clear_flag('actions.set-policy')
This diff is collapsed.
#!/bin/bash
sudo add-apt-repository ppa:juju/stable -y
sudo apt-get update
sudo apt-get install amulet python-requests -y
#!/usr/bin/python3
import amulet
import requests
import unittest
class TestCharm(unittest.TestCase):
def setUp(self):
self.d = amulet.Deployment()
self.d.add('vnf-b')
self.d.expose('vnf-b')
self.d.setup(timeout=900)
self.d.sentry.wait()
self.unit = self.d.sentry['vnf-b'][0]
def test_service(self):
# test we can access over http
page = requests.get('http://{}'.format(self.unit.info['public-address']))
self.assertEqual(page.status_code, 200)
# Now you can use self.d.sentry[SERVICE][UNIT] to address each of the units and perform
# more in-depth steps. Each self.d.sentry[SERVICE][UNIT] has the following methods:
# - .info - An array of the information of that unit from Juju
# - .file(PATH) - Get the details of a file on that unit
# - .file_contents(PATH) - Get plain text output of PATH file from that unit
# - .directory(PATH) - Get details of directory
# - .directory_contents(PATH) - List files and folders in PATH on that unit
# - .relation(relation, service:rel) - Get relation data from return service
if __name__ == '__main__':
unittest.main()
83c13bd
\ No newline at end of file
#cloud-config
password: osm4u
chpasswd: { expire: False }
ssh_pwauth: True
write_files:
- content: |
# My new helloworld file
owner: root:root
permissions: '0644'
path: /root/helloworld.txt
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment