diff --git a/.gitignore b/.gitignore
index b06dc10e1b3f18edea0631bf2228e99d0abd4947..484eb1aa198c5fde339b36d84e7362be806b9e06 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,4 +19,11 @@ assets/.nosync
# Web Server #
##########################
-pythonweb.py
\ No newline at end of file
+pythonweb.py
+
+# IDEs
+.project
+
+# Generated output from examples
+charms/
+.tar.gz
diff --git a/examples/NextEPC/build.sh b/examples/NextEPC/build.sh
new file mode 100755
index 0000000000000000000000000000000000000000..506db3e2a911d22510d0504c4f3e91c01df3bb53
--- /dev/null
+++ b/examples/NextEPC/build.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+export JUJU_REPOSITORY=`pwd`/charm-sources
+export CHARM_LAYERS_DIR=$JUJU_REPOSITORY/layers
+export CHARM_BUILD_DIR=`pwd`/vEPC_vnfd/charms
+
+rm -rf $CHARM_BUILD_DIR
+
+for charm in hsscharm spgwcharm; do
+ cd $CHARM_LAYERS_DIR/$charm
+ charm build &
+ cd -
+done
+
+wait
+
+for file in vEPC_nsd vEPC_vnfd
+do
+ rm ${file}.tar.gz
+ tar -czf ${file}.tar.gz ${file}/
+done
+
+osm nsd-delete vEPC_nsd
+osm vnfd-delete vEPC_vnfd
+
+osm vnfd-create vEPC_vnfd.tar.gz || exit 1
+osm nsd-create vEPC_nsd.tar.gz || exit 1
+
+osm ns-create --ns_name EPC1 --nsd_name vEPC_nsd --ssh_keys ~/.ssh/id_rsa.pub --config_file params.yaml --vim_account vnfob
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/README.ex b/examples/NextEPC/charm-sources/layers/hsscharm/README.ex
new file mode 100644
index 0000000000000000000000000000000000000000..b6816b22ade2fa36326d7e1f612b6f6203768949
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/README.ex
@@ -0,0 +1,65 @@
+# Overview
+
+Describe the intended usage of this charm and anything unique about how this
+charm relates to others here.
+
+This README will be displayed in the Charm Store, it should be either Markdown
+or RST. Ideal READMEs include instructions on how to use the charm, expected
+usage, and charm features that your audience might be interested in. For an
+example of a well written README check out Hadoop:
+http://jujucharms.com/charms/precise/hadoop
+
+Use this as a Markdown reference if you need help with the formatting of this
+README: http://askubuntu.com/editing-help
+
+This charm provides [service][]. Add a description here of what the service
+itself actually does.
+
+Also remember to check the [icon guidelines][] so that your charm looks good
+in the Juju GUI.
+
+# Usage
+
+Step by step instructions on using the charm:
+
+juju deploy servicename
+
+and so on. If you're providing a web service or something that the end user
+needs to go to, tell them here, especially if you're deploying a service that
+might listen to a non-default port.
+
+You can then browse to http://ip-address to configure the service.
+
+## Scale out Usage
+
+If the charm has any recommendations for running at scale, outline them in
+examples here. For example if you have a memcached relation that improves
+performance, mention it here.
+
+## Known Limitations and Issues
+
+This not only helps users but gives people a place to start if they want to help
+you add features to your charm.
+
+# Configuration
+
+The configuration options will be listed on the charm store, however If you're
+making assumptions or opinionated decisions in the charm (like setting a default
+administrator password), you should detail that here so the user knows how to
+change it immediately, etc.
+
+# Contact Information
+
+Though this will be listed in the charm store itself don't assume a user will
+know that, so include that information here:
+
+## Upstream Project Name
+
+ - Upstream website
+ - Upstream bug tracker
+ - Upstream mailing list or contact information
+ - Feel free to add things if it's useful for users
+
+
+[service]: http://example.com
+[icon guidelines]: https://jujucharms.com/docs/stable/authors-charm-icon
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/actions.yaml b/examples/NextEPC/charm-sources/layers/hsscharm/actions.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..52fce3134e27eb5a050ea16ce97d7bec8f6edf80
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/actions.yaml
@@ -0,0 +1,13 @@
+configure-hss:
+ description: "Configures the HSS"
+ params:
+ hss-ip:
+ description: "HSS IP"
+ type: string
+ default: "0.0.0.0"
+ spgw-ip:
+ description: "SPGW IP"
+ type: string
+ default: "0.0.0.0"
+restart-hss:
+ description: "Restarts the service of the VNF"
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/actions/configure-hss b/examples/NextEPC/charm-sources/layers/hsscharm/actions/configure-hss
new file mode 100755
index 0000000000000000000000000000000000000000..7d02e2d1c65b139b8840ba6d935f85899fab2ce0
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/actions/configure-hss
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+import sys
+sys.path.append('lib')
+
+from charms.reactive import main
+from charms.reactive import set_state
+from charmhelpers.core.hookenv import action_fail, action_name
+
+"""
+`set_state` only works here because it's flushed to disk inside the `main()`
+loop. remove_state will need to be called inside the action method.
+"""
+set_state('actions.{}'.format(action_name()))
+
+try:
+ main()
+except Exception as e:
+ action_fail(repr(e))
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/actions/restart-hss b/examples/NextEPC/charm-sources/layers/hsscharm/actions/restart-hss
new file mode 100755
index 0000000000000000000000000000000000000000..7d02e2d1c65b139b8840ba6d935f85899fab2ce0
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/actions/restart-hss
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+import sys
+sys.path.append('lib')
+
+from charms.reactive import main
+from charms.reactive import set_state
+from charmhelpers.core.hookenv import action_fail, action_name
+
+"""
+`set_state` only works here because it's flushed to disk inside the `main()`
+loop. remove_state will need to be called inside the action method.
+"""
+set_state('actions.{}'.format(action_name()))
+
+try:
+ main()
+except Exception as e:
+ action_fail(repr(e))
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/config.yaml b/examples/NextEPC/charm-sources/layers/hsscharm/config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..51f2ce4a07bddfbc72679ec14280fd6461cb307d
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/config.yaml
@@ -0,0 +1,14 @@
+options:
+ string-option:
+ type: string
+ default: "Default Value"
+ description: "A short description of the configuration option"
+ boolean-option:
+ type: boolean
+ default: False
+ description: "A short description of the configuration option"
+ int-option:
+ type: int
+ default: 9001
+ description: "A short description of the configuration option"
+
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/icon.svg b/examples/NextEPC/charm-sources/layers/hsscharm/icon.svg
new file mode 100644
index 0000000000000000000000000000000000000000..96a5d0c068d4b3271c7e397f76cf77fdf0651038
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/icon.svg
@@ -0,0 +1,279 @@
+
+
+
+
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/layer.yaml b/examples/NextEPC/charm-sources/layers/hsscharm/layer.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..aa4dc07fc4b30895e983c64be20845aaae5ab094
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/layer.yaml
@@ -0,0 +1,3 @@
+includes:
+ - layer:basic
+ - layer:vnfproxy
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/metadata.yaml b/examples/NextEPC/charm-sources/layers/hsscharm/metadata.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..73ba0cf5d58caafb494580ab9f4fd4b4f96c6481
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/metadata.yaml
@@ -0,0 +1,11 @@
+name: hsscharm
+summary: NextEPC HSS Charm
+maintainer: Your name
+description: |
+ This is an example of a proxy charm deployed by Open Source Mano.
+tags:
+ - nfv
+subordinate: false
+series:
+ - trusty
+ - xenial
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/reactive/hsscharm.py b/examples/NextEPC/charm-sources/layers/hsscharm/reactive/hsscharm.py
new file mode 100644
index 0000000000000000000000000000000000000000..73ab30084ea6b56b830528b52db7a7e635436d43
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/reactive/hsscharm.py
@@ -0,0 +1,48 @@
+from charms.reactive import when, when_not, set_flag
+
+from charmhelpers.core.hookenv import (
+ action_get,
+ action_fail,
+ action_set,
+ config,
+ status_set,
+)
+
+from charms.reactive import (
+ remove_state as remove_flag,
+ set_state as set_flag,
+ when, when_not
+)
+
+import charms.sshproxy
+
+@when_not('hsscharm.installed')
+def install_hsscharm():
+ # Do your setup here.
+ #
+ # If your charm has other dependencies before it can install,
+ # add those as @when() clauses above., or as additional @when()
+ # decorated handlers below
+ #
+ # See the following for information about reactive charms:
+ #
+ # * https://jujucharms.com/docs/devel/developer-getting-started
+ # * https://github.com/juju-solutions/layer-basic#overview
+ #
+ set_flag('hsscharm.installed')
+
+@when('actions.configure-hss')
+def configure_hss():
+ spgw_ip = action_get('spgw-ip')
+ hss_ip = action_get('hss-ip')
+ cmd = 'sudo sed -i "\'s/$hss_ip/{}/g\'" /etc/nextepc/freeDiameter/hss.conf'.format(hss_ip)
+ charms.sshproxy._run(cmd)
+ cmd = 'sudo sed -i "\'s/$spgw_ip/{}/g\'" /etc/nextepc/freeDiameter/hss.conf'.format(spgw_ip)
+ charms.sshproxy._run(cmd)
+ remove_flag('actions.configure-hss')
+
+@when('actions.restart-hss')
+def restart_hss():
+ cmd = "sudo systemctl restart nextepc-hssd"
+ charms.sshproxy._run(cmd)
+ remove_flag('actions.restart-hss')
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/tests/00-setup b/examples/NextEPC/charm-sources/layers/hsscharm/tests/00-setup
new file mode 100755
index 0000000000000000000000000000000000000000..f0616a560a811bae78d7872dd433d612909c73cd
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/tests/00-setup
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+sudo add-apt-repository ppa:juju/stable -y
+sudo apt-get update
+sudo apt-get install amulet python-requests -y
diff --git a/examples/NextEPC/charm-sources/layers/hsscharm/tests/10-deploy b/examples/NextEPC/charm-sources/layers/hsscharm/tests/10-deploy
new file mode 100755
index 0000000000000000000000000000000000000000..17515e3245869cba592428460cd15327136301a9
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/hsscharm/tests/10-deploy
@@ -0,0 +1,35 @@
+#!/usr/bin/python3
+
+import amulet
+import requests
+import unittest
+
+
+class TestCharm(unittest.TestCase):
+ def setUp(self):
+ self.d = amulet.Deployment()
+
+ self.d.add('hsscharm')
+ self.d.expose('hsscharm')
+
+ self.d.setup(timeout=900)
+ self.d.sentry.wait()
+
+ self.unit = self.d.sentry['hsscharm'][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()
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/README.ex b/examples/NextEPC/charm-sources/layers/spgwcharm/README.ex
new file mode 100644
index 0000000000000000000000000000000000000000..b6816b22ade2fa36326d7e1f612b6f6203768949
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/README.ex
@@ -0,0 +1,65 @@
+# Overview
+
+Describe the intended usage of this charm and anything unique about how this
+charm relates to others here.
+
+This README will be displayed in the Charm Store, it should be either Markdown
+or RST. Ideal READMEs include instructions on how to use the charm, expected
+usage, and charm features that your audience might be interested in. For an
+example of a well written README check out Hadoop:
+http://jujucharms.com/charms/precise/hadoop
+
+Use this as a Markdown reference if you need help with the formatting of this
+README: http://askubuntu.com/editing-help
+
+This charm provides [service][]. Add a description here of what the service
+itself actually does.
+
+Also remember to check the [icon guidelines][] so that your charm looks good
+in the Juju GUI.
+
+# Usage
+
+Step by step instructions on using the charm:
+
+juju deploy servicename
+
+and so on. If you're providing a web service or something that the end user
+needs to go to, tell them here, especially if you're deploying a service that
+might listen to a non-default port.
+
+You can then browse to http://ip-address to configure the service.
+
+## Scale out Usage
+
+If the charm has any recommendations for running at scale, outline them in
+examples here. For example if you have a memcached relation that improves
+performance, mention it here.
+
+## Known Limitations and Issues
+
+This not only helps users but gives people a place to start if they want to help
+you add features to your charm.
+
+# Configuration
+
+The configuration options will be listed on the charm store, however If you're
+making assumptions or opinionated decisions in the charm (like setting a default
+administrator password), you should detail that here so the user knows how to
+change it immediately, etc.
+
+# Contact Information
+
+Though this will be listed in the charm store itself don't assume a user will
+know that, so include that information here:
+
+## Upstream Project Name
+
+ - Upstream website
+ - Upstream bug tracker
+ - Upstream mailing list or contact information
+ - Feel free to add things if it's useful for users
+
+
+[service]: http://example.com
+[icon guidelines]: https://jujucharms.com/docs/stable/authors-charm-icon
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/actions.yaml b/examples/NextEPC/charm-sources/layers/spgwcharm/actions.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..84ab2738c1cddfdcab0bb3a7f92525d63c54a608
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/actions.yaml
@@ -0,0 +1,24 @@
+configure-spgw:
+ description: "Configures the SPGW"
+ params:
+ hss-ip:
+ description: "HSS IP"
+ type: string
+ default: "0.0.0.0"
+ spgw-ip:
+ description: "SPGW IP"
+ type: string
+ default: "0.0.0.0"
+add-route:
+ description: "Adds a route to the SPGW"
+ params:
+ external-prefix:
+ description: "Destinaton prefix IP"
+ type: string
+ default: "8.8.8.8/32"
+ next-hop:
+ description: "SGI next hop"
+ type: string
+ default: "192.168.2.1"
+restart-spgw:
+ description: "Restarts the service of the VNF"
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/actions/add-route b/examples/NextEPC/charm-sources/layers/spgwcharm/actions/add-route
new file mode 100755
index 0000000000000000000000000000000000000000..7d02e2d1c65b139b8840ba6d935f85899fab2ce0
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/actions/add-route
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+import sys
+sys.path.append('lib')
+
+from charms.reactive import main
+from charms.reactive import set_state
+from charmhelpers.core.hookenv import action_fail, action_name
+
+"""
+`set_state` only works here because it's flushed to disk inside the `main()`
+loop. remove_state will need to be called inside the action method.
+"""
+set_state('actions.{}'.format(action_name()))
+
+try:
+ main()
+except Exception as e:
+ action_fail(repr(e))
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/actions/configure-spgw b/examples/NextEPC/charm-sources/layers/spgwcharm/actions/configure-spgw
new file mode 100755
index 0000000000000000000000000000000000000000..7d02e2d1c65b139b8840ba6d935f85899fab2ce0
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/actions/configure-spgw
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+import sys
+sys.path.append('lib')
+
+from charms.reactive import main
+from charms.reactive import set_state
+from charmhelpers.core.hookenv import action_fail, action_name
+
+"""
+`set_state` only works here because it's flushed to disk inside the `main()`
+loop. remove_state will need to be called inside the action method.
+"""
+set_state('actions.{}'.format(action_name()))
+
+try:
+ main()
+except Exception as e:
+ action_fail(repr(e))
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/actions/restart-spgw b/examples/NextEPC/charm-sources/layers/spgwcharm/actions/restart-spgw
new file mode 100755
index 0000000000000000000000000000000000000000..7d02e2d1c65b139b8840ba6d935f85899fab2ce0
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/actions/restart-spgw
@@ -0,0 +1,18 @@
+#!/usr/bin/env python3
+import sys
+sys.path.append('lib')
+
+from charms.reactive import main
+from charms.reactive import set_state
+from charmhelpers.core.hookenv import action_fail, action_name
+
+"""
+`set_state` only works here because it's flushed to disk inside the `main()`
+loop. remove_state will need to be called inside the action method.
+"""
+set_state('actions.{}'.format(action_name()))
+
+try:
+ main()
+except Exception as e:
+ action_fail(repr(e))
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/config.yaml b/examples/NextEPC/charm-sources/layers/spgwcharm/config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..51f2ce4a07bddfbc72679ec14280fd6461cb307d
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/config.yaml
@@ -0,0 +1,14 @@
+options:
+ string-option:
+ type: string
+ default: "Default Value"
+ description: "A short description of the configuration option"
+ boolean-option:
+ type: boolean
+ default: False
+ description: "A short description of the configuration option"
+ int-option:
+ type: int
+ default: 9001
+ description: "A short description of the configuration option"
+
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/icon.svg b/examples/NextEPC/charm-sources/layers/spgwcharm/icon.svg
new file mode 100644
index 0000000000000000000000000000000000000000..96a5d0c068d4b3271c7e397f76cf77fdf0651038
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/icon.svg
@@ -0,0 +1,279 @@
+
+
+
+
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/layer.yaml b/examples/NextEPC/charm-sources/layers/spgwcharm/layer.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..aa4dc07fc4b30895e983c64be20845aaae5ab094
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/layer.yaml
@@ -0,0 +1,3 @@
+includes:
+ - layer:basic
+ - layer:vnfproxy
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/metadata.yaml b/examples/NextEPC/charm-sources/layers/spgwcharm/metadata.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..ab6bda73787b5d8253709a79769c815953e02496
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/metadata.yaml
@@ -0,0 +1,11 @@
+name: spgwcharm
+summary: NextEPC SPGW Charm
+maintainer: Your name
+description: |
+ This is an example of a proxy charm deployed by Open Source Mano.
+tags:
+ - nfv
+subordinate: false
+series:
+ - trusty
+ - xenial
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/reactive/spgwcharm.py b/examples/NextEPC/charm-sources/layers/spgwcharm/reactive/spgwcharm.py
new file mode 100644
index 0000000000000000000000000000000000000000..ecd3960d2bf3d6b53693b3a0d1695ea19f4061c8
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/reactive/spgwcharm.py
@@ -0,0 +1,46 @@
+from charms.reactive import when, when_not, set_flag
+
+from charmhelpers.core.hookenv import (
+ action_get,
+ action_fail,
+ action_set,
+ config,
+ status_set,
+)
+
+from charms.reactive import (
+ remove_state as remove_flag,
+ set_state as set_flag,
+ when, when_not
+)
+
+import charms.sshproxy
+
+@when('actions.configure-spgw')
+def configure_spgw():
+ hss_ip = action_get('hss-ip')
+ spgw_ip = action_get('spgw-ip')
+ cmd = 'sudo sed -i "\'s/$hss_ip/{}/g\'" /etc/nextepc/freeDiameter/mme.conf'.format(hss_ip)
+ charms.sshproxy._run(cmd)
+ cmd = 'sudo sed -i "\'s/$spgw_ip/{}/g\'" /etc/nextepc/freeDiameter/mme.conf'.format(spgw_ip)
+ charms.sshproxy._run(cmd)
+ remove_flag('actions.configure-spgw')
+
+@when('actions.restart-spgw')
+def restart_spgw():
+ cmd = "sudo systemctl restart nextepc-mmed"
+ charms.sshproxy._run(cmd)
+ remove_flag('actions.restart-spgw')
+
+@when_not('spgwcharm.installed')
+def install_spgwcharm():
+ set_flag('spgwcharm.installed')
+
+@when('actions.add-route')
+def add_route():
+ prefix = action_get('external-prefix')
+ next_hop = action_get('next-hop')
+ cmd = "sudo route add -net " + prefix + " gw " + next_hop
+ charms.sshproxy._run(cmd)
+ remove_flag('actions.add-route')
+
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/tests/00-setup b/examples/NextEPC/charm-sources/layers/spgwcharm/tests/00-setup
new file mode 100755
index 0000000000000000000000000000000000000000..f0616a560a811bae78d7872dd433d612909c73cd
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/tests/00-setup
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+sudo add-apt-repository ppa:juju/stable -y
+sudo apt-get update
+sudo apt-get install amulet python-requests -y
diff --git a/examples/NextEPC/charm-sources/layers/spgwcharm/tests/10-deploy b/examples/NextEPC/charm-sources/layers/spgwcharm/tests/10-deploy
new file mode 100755
index 0000000000000000000000000000000000000000..a98ff4c328754765ea301a2a4ec0e0842b539d4a
--- /dev/null
+++ b/examples/NextEPC/charm-sources/layers/spgwcharm/tests/10-deploy
@@ -0,0 +1,35 @@
+#!/usr/bin/python3
+
+import amulet
+import requests
+import unittest
+
+
+class TestCharm(unittest.TestCase):
+ def setUp(self):
+ self.d = amulet.Deployment()
+
+ self.d.add('spgwcharm')
+ self.d.expose('spgwcharm')
+
+ self.d.setup(timeout=900)
+ self.d.sentry.wait()
+
+ self.unit = self.d.sentry['spgwcharm'][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()
diff --git a/examples/NextEPC/params.yaml b/examples/NextEPC/params.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..372c391efff5ecb45e25c102b246c3b1fca3d913
--- /dev/null
+++ b/examples/NextEPC/params.yaml
@@ -0,0 +1,16 @@
+additionalParamsForVnf:
+- member-vnf-index: '1'
+ additionalParams:
+ spgw_ip: '10.0.6.15'
+ hss_ip: '10.0.6.20'
+ password: 'osm4us'
+
+vnf:
+- member-vnf-index: '1'
+ internal-vld:
+ - name: s6a
+ internal-connection-point:
+ - id-ref: spgwmme-s6a
+ ip-address: 10.0.6.15
+ - id-ref: hss-s6a
+ ip-address: 10.0.6.20
diff --git a/examples/NextEPC/vEPC_nsd/README b/examples/NextEPC/vEPC_nsd/README
new file mode 100644
index 0000000000000000000000000000000000000000..81581bdce9486ed53dee50dcafe102fcf0838366
--- /dev/null
+++ b/examples/NextEPC/vEPC_nsd/README
@@ -0,0 +1,2 @@
+Descriptor created by OSM descriptor package generated
+Created on Thu Sep 5 15:28:15 EDT 2019
diff --git a/examples/NextEPC/vEPC_nsd/vEPC_nsd.yaml b/examples/NextEPC/vEPC_nsd/vEPC_nsd.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..c8a1598cfc4fb6a24a3fd4bb5c45e77386bf55df
--- /dev/null
+++ b/examples/NextEPC/vEPC_nsd/vEPC_nsd.yaml
@@ -0,0 +1,45 @@
+nsd:nsd-catalog:
+ nsd:
+ - id: vEPC_nsd
+ name: vEPC_nsd
+ short-name: vEPC_nsd
+ description: Generated by OSM package generator
+ vendor: OSM_VNFONB_TF
+ version: '1.0'
+ constituent-vnfd:
+ - member-vnf-index: 1
+ vnfd-id-ref: vEPC_vnfd
+ vld:
+ - id: management
+ name: management
+ short-name: management
+ type: ELAN
+ mgmt-network: 'true'
+ vim-network-name: osm-ext
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: 1
+ vnfd-id-ref: vEPC_vnfd
+ vnfd-connection-point-ref: spgwmme-mgmt
+ - member-vnf-index-ref: 1
+ vnfd-id-ref: vEPC_vnfd
+ vnfd-connection-point-ref: hss-mgmt
+ - id: s1
+ name: s1
+ short-name: s1
+ type: ELAN
+ vim-network-name: s1
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: 1
+ vnfd-id-ref: vEPC_vnfd
+ vnfd-connection-point-ref: spgwmme-s1
+ ip-address: 192.168.0.11
+ - id: sgi
+ name: sgi
+ short-name: sgi
+ type: ELAN
+ vim-network-name: sgi
+ vnfd-connection-point-ref:
+ - member-vnf-index-ref: 1
+ vnfd-id-ref: vEPC_vnfd
+ vnfd-connection-point-ref: spgwmme-sgi
+ ip-address: 192.168.2.11
diff --git a/examples/NextEPC/vEPC_vnfd/README b/examples/NextEPC/vEPC_vnfd/README
new file mode 100644
index 0000000000000000000000000000000000000000..81581bdce9486ed53dee50dcafe102fcf0838366
--- /dev/null
+++ b/examples/NextEPC/vEPC_vnfd/README
@@ -0,0 +1,2 @@
+Descriptor created by OSM descriptor package generated
+Created on Thu Sep 5 15:28:15 EDT 2019
diff --git a/examples/NextEPC/vEPC_vnfd/cloud_init/hss-init b/examples/NextEPC/vEPC_vnfd/cloud_init/hss-init
new file mode 100644
index 0000000000000000000000000000000000000000..d6e39feaf0d9db80d0cdaa9c22214da88ed6b2b2
--- /dev/null
+++ b/examples/NextEPC/vEPC_vnfd/cloud_init/hss-init
@@ -0,0 +1,18 @@
+#cloud-config
+hostname: nextepc-hss
+password: {{ password }}
+chpasswd: { expire: False }
+ssh_pwauth: True
+
+write_files:
+- owner: root:root
+ content: |
+ network:
+ version: 2
+ ethernets:
+ ens4:
+ dhcp4: true
+ path: /etc/netplan/51-additional-interfaces.yaml
+runcmd:
+- /sbin/ip link set ens4 up
+- /usr/sbin/netplan apply
diff --git a/examples/NextEPC/vEPC_vnfd/cloud_init/spgwmme-init b/examples/NextEPC/vEPC_vnfd/cloud_init/spgwmme-init
new file mode 100644
index 0000000000000000000000000000000000000000..a89ae90b4952a5d6e13e215feafd68b58775f883
--- /dev/null
+++ b/examples/NextEPC/vEPC_vnfd/cloud_init/spgwmme-init
@@ -0,0 +1,24 @@
+#cloud-config
+hostname: nextepc-spgw
+password: {{ password }}
+chpasswd: { expire: False }
+ssh_pwauth: True
+
+write_files:
+- owner: root:root
+ content: |
+ network:
+ version: 2
+ ethernets:
+ ens4:
+ dhcp4: true
+ ens5:
+ dhcp4: true
+ ens6:
+ dhcp4: true
+ path: /etc/netplan/51-additional-interfaces.yaml
+runcmd:
+- /sbin/ip link set ens4 up
+- /sbin/ip link set ens5 up
+- /sbin/ip link set ens6 up
+- /usr/sbin/netplan apply
diff --git a/examples/NextEPC/vEPC_vnfd/vEPC_vnfd.yaml b/examples/NextEPC/vEPC_vnfd/vEPC_vnfd.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..e61e202f37507e4ef996780dda77a05b63fb92a8
--- /dev/null
+++ b/examples/NextEPC/vEPC_vnfd/vEPC_vnfd.yaml
@@ -0,0 +1,184 @@
+vnfd:vnfd-catalog:
+ vnfd:
+ - id: vEPC_vnfd
+ name: vEPC_vnfd
+ short-name: vEPC_vnfd
+ description: Generated by OSM package generator
+ vendor: OSM_VNFONB_TF
+ version: '1.0'
+ mgmt-interface:
+ cp: spgwmme-mgmt
+
+ vdu:
+ - id: spgwmme
+ name: spgwmme
+ description: spgwmme
+ count: 1
+ cloud-init-file: spgwmme-init
+# guest-epa:
+# cpu-pinning-policy: DEDICATED
+# mempage-size: LARGE
+ vm-flavor:
+ vcpu-count: 2
+ memory-mb: 4096
+ storage-gb: 10
+ image: 'nextepc-spgwmme-base'
+ interface:
+ - name: eth0
+ type: EXTERNAL
+ virtual-interface:
+ type: PARAVIRT
+ external-connection-point-ref: spgwmme-mgmt
+ - name: eth1
+ type: EXTERNAL
+ virtual-interface:
+# type: SRIOV
+ type: PARAVIRT
+ external-connection-point-ref: spgwmme-s1
+ - name: eth2
+ type: EXTERNAL
+ virtual-interface:
+# type: SRIOV
+ type: PARAVIRT
+ external-connection-point-ref: spgwmme-sgi
+ - name: eth3
+ type: INTERNAL
+ virtual-interface:
+ type: PARAVIRT
+ internal-connection-point-ref: spgwmme-s6a
+ internal-connection-point:
+ - id: spgwmme-s6a
+ name: spgwmme-s6a
+ type: VPORT
+ monitoring-param:
+ - id: "spgw_cpu_util"
+ nfvi-metric: "cpu_utilization"
+ - id: "spgw_memory_util"
+ nfvi-metric: "average_memory_utilization"
+
+ - id: hss
+ name: hss
+ description: hss
+ count: 1
+ cloud-init-file: hss-init
+ vm-flavor:
+ vcpu-count: 1
+ memory-mb: 2048
+ storage-gb: 10
+ image: 'nextepc-hss-base'
+ interface:
+ - name: eth0
+ type: EXTERNAL
+ virtual-interface:
+ type: PARAVIRT
+ mgmt-interface: true
+ external-connection-point-ref: hss-mgmt
+ - name: eth1
+ type: INTERNAL
+ virtual-interface:
+ type: PARAVIRT
+ internal-connection-point-ref: hss-s6a
+ internal-connection-point:
+ - id: hss-s6a
+ name: hss-s6a
+ type: VPORT
+ vdu-configuration:
+ initial-config-primitive:
+ - seq: '1'
+ name: config
+ parameter:
+ - name: ssh-hostname
+ value:
+ - name: ssh-username
+ value: ubuntu
+ - name: ssh-password
+ value:
+ - seq: '2'
+ name: configure-hss
+ parameter:
+ - name: spgw-ip
+ data-type: STRING
+ value:
+ - name: hss-ip
+ data-type: STRING
+ value:
+ - seq: '3'
+ name: restart-hss
+ juju:
+ charm: hsscharm
+
+
+ internal-vld:
+ - id: s6a
+ ip-profile-ref: s6a
+ internal-connection-point:
+ - id-ref: spgwmme-s6a
+ - id-ref: hss-s6a
+ name: s6a
+
+ ip-profiles:
+ - name: s6a
+ description: s6a network
+ ip-profile-params:
+ ip-version: ipv4
+ subnet-address: 10.0.6.0/24
+ dhcp-params:
+ enabled: true
+
+
+ connection-point:
+ - name: spgwmme-mgmt
+ - name: spgwmme-s1
+ - name: spgwmme-sgi
+ - name: hss-mgmt
+
+
+ vnf-configuration:
+ initial-config-primitive:
+ - seq: '1'
+ name: config
+ parameter:
+ - name: ssh-hostname
+ value:
+ - name: ssh-username
+ value: ubuntu
+ - name: ssh-password
+ value:
+ - seq: '2'
+ name: configure-spgw
+ parameter:
+ - name: spgw-ip
+ data-type: STRING
+ value:
+ - name: hss-ip
+ data-type: STRING
+ value:
+ - seq: '3'
+ name: restart-spgw
+ config-primitive:
+ - name: add-route
+ parameter:
+ - name: external-prefix
+ data-type: STRING
+ default-value: '8.8.8.8/32'
+ - name: next-hop
+ data-type: STRING
+ default-value: '192.168.2.1'
+ juju:
+ charm: spgwcharm
+
+
+ monitoring-param:
+ - id: "spgw_cpu_util"
+ name: "spgw_cpu_util"
+ aggregation-type: AVERAGE
+ vdu-monitoring-param:
+ vdu-ref: "spgwmme"
+ vdu-monitoring-param-ref: "spgw_cpu_util"
+ - id: "spgw_memory_util"
+ name: "spgw_memory_util"
+ aggregation-type: AVERAGE
+ vdu-monitoring-param:
+ vdu-ref: "spgwmme"
+ vdu-monitoring-param-ref: "spgw_memory_util"
+