Update velia
New features:
* Faster sysfs hwmon reading of data in our PSU and PDU.
* Reporting systemd unit failures via sysrepo (ietf-alarms).
This also needs a migration because the original code ignored failures
of systemd-journal-upload service. Let's keep it that way.
Change-Id: I4464aa2ffe254cc50bca844b891c78c00f5597e3
diff --git a/package/czechlight-cfg-fs/czechlight-install-yang.sh b/package/czechlight-cfg-fs/czechlight-install-yang.sh
index edfd6b1..8924417 100755
--- a/package/czechlight-cfg-fs/czechlight-install-yang.sh
+++ b/package/czechlight-cfg-fs/czechlight-install-yang.sh
@@ -93,3 +93,5 @@
sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-firewall@2021-01-25.yang --permissions 0600
sysrepoctl --change ietf-access-control-list --enable-feature match-on-eth --enable-feature eth --enable-feature match-on-ipv4 --enable-feature ipv4 --enable-feature match-on-ipv6 --enable-feature ipv6 --enable-feature mixed-eth-ipv4-ipv6
+
+sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/velia-alarms@2022-07-12.yang --permissions 0660
diff --git a/package/czechlight-cfg-fs/czechlight-migration-list.sh b/package/czechlight-cfg-fs/czechlight-migration-list.sh
index 84d26a0..6754752 100644
--- a/package/czechlight-cfg-fs/czechlight-migration-list.sh
+++ b/package/czechlight-cfg-fs/czechlight-migration-list.sh
@@ -1,4 +1,5 @@
MIGRATION_FILES=(
'0001_initial-data.sh'
'0002_default_startup_configuration_for_ietf-interfaces.sh'
+ '0003_shelve_alarms.sh'
)
diff --git a/package/czechlight-cfg-fs/migrations/0003_ietf-alarms_shelve-journal-upload.json b/package/czechlight-cfg-fs/migrations/0003_ietf-alarms_shelve-journal-upload.json
new file mode 100644
index 0000000..7ce6b7e
--- /dev/null
+++ b/package/czechlight-cfg-fs/migrations/0003_ietf-alarms_shelve-journal-upload.json
@@ -0,0 +1,23 @@
+{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "description": "Ignore systemd-journal-upload.service failures",
+ "resource": [
+ "systemd-journal-upload.service"
+ ],
+ "alarm-type": [
+ {
+ "alarm-type-id": "velia-alarms:systemd-unit-failure",
+ "alarm-type-qualifier-match": ""
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/package/czechlight-cfg-fs/migrations/0003_shelve_alarms.sh b/package/czechlight-cfg-fs/migrations/0003_shelve_alarms.sh
new file mode 100644
index 0000000..c679ebb
--- /dev/null
+++ b/package/czechlight-cfg-fs/migrations/0003_shelve_alarms.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Ignore failures from systemd-journal-upload.service
+# ---------------------------------------------------
+# After migration to ietf-alarms based health state reporting we should
+# keep the current settings, i.e., ignore alarms coming from this particular
+# systemd-journal-upload.service
+#
+sysrepocfg --datastore=startup --format=json --module=ietf-alarms --import="${MIGRATIONS_DIRECTORY}/0003_ietf-alarms_shelve-journal-upload.json"
diff --git a/package/velia/velia-health.service b/package/velia/velia-health.service
index 05f66c2..61b58c1 100644
--- a/package/velia/velia-health.service
+++ b/package/velia/velia-health.service
@@ -7,7 +7,7 @@
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'for COLOUR in red green blue; do echo none > /sys/class/leds/status:$${COLOUR}/trigger; echo 0 > /sys/class/leds/status:green/brightness; done'
-ExecStart=/usr/bin/veliad-health --appliance=czechlight-clearfog --systemd-ignore-unit=systemd-journal-upload.service
+ExecStart=/usr/bin/veliad-health --appliance=czechlight-clearfog
ExecStopPost=/bin/sh -c 'for COLOUR in red green blue; do echo 0 > /sys/class/leds/status:$$COLOUR/brightness; done; [[ "$EXIT_CODE" == "exited" ]] && COLOUR="green" || COLOUR="red"; echo timer > /sys/class/leds/status:$$COLOUR/trigger; echo 256 > /sys/class/leds/status:$$COLOUR/brightness'
Group=sysrepo
PrivateTmp=yes
diff --git a/submodules/velia b/submodules/velia
index 2030fc4..39db333 160000
--- a/submodules/velia
+++ b/submodules/velia
@@ -1 +1 @@
-Subproject commit 2030fc463f318fa6e09c7ddf502121d28ca67339
+Subproject commit 39db333deca063e3ffd670db4cb7088b06053899
diff --git a/tests/czechlight-cfg-fs/data/v0_sdn-inline_empty/expected.json b/tests/czechlight-cfg-fs/data/v0_sdn-inline_empty/expected.json
index a31986c..59f7990 100644
--- a/tests/czechlight-cfg-fs/data/v0_sdn-inline_empty/expected.json
+++ b/tests/czechlight-cfg-fs/data/v0_sdn-inline_empty/expected.json
@@ -1,4 +1,25 @@
{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "resource": [
+ "systemd-journal-upload.service"
+ ],
+ "alarm-type": [
+ {
+ "alarm-type-id": "velia-alarms:systemd-unit-failure",
+ "alarm-type-qualifier-match": ""
+ }
+ ],
+ "description": "Ignore systemd-journal-upload.service failures"
+ }
+ ]
+ }
+ }
+ },
"ietf-interfaces:interfaces": {
"interface": [
{
diff --git a/tests/czechlight-cfg-fs/data/v0_sdn-inline_somedata/expected.json b/tests/czechlight-cfg-fs/data/v0_sdn-inline_somedata/expected.json
index ff070e2..41dafc9 100644
--- a/tests/czechlight-cfg-fs/data/v0_sdn-inline_somedata/expected.json
+++ b/tests/czechlight-cfg-fs/data/v0_sdn-inline_somedata/expected.json
@@ -1,4 +1,25 @@
{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "resource": [
+ "systemd-journal-upload.service"
+ ],
+ "alarm-type": [
+ {
+ "alarm-type-id": "velia-alarms:systemd-unit-failure",
+ "alarm-type-qualifier-match": ""
+ }
+ ],
+ "description": "Ignore systemd-journal-upload.service failures"
+ }
+ ]
+ }
+ }
+ },
"ietf-interfaces:interfaces": {
"interface": [
{
diff --git a/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_empty/expected.json b/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_empty/expected.json
index 20975b2..edc8766 100644
--- a/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_empty/expected.json
+++ b/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_empty/expected.json
@@ -1,4 +1,25 @@
{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "resource": [
+ "systemd-journal-upload.service"
+ ],
+ "alarm-type": [
+ {
+ "alarm-type-id": "velia-alarms:systemd-unit-failure",
+ "alarm-type-qualifier-match": ""
+ }
+ ],
+ "description": "Ignore systemd-journal-upload.service failures"
+ }
+ ]
+ }
+ }
+ },
"ietf-interfaces:interfaces": {
"interface": [
{
diff --git a/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_with_altered_initial_data/expected.json b/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_with_altered_initial_data/expected.json
index 20975b2..edc8766 100644
--- a/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_with_altered_initial_data/expected.json
+++ b/tests/czechlight-cfg-fs/data/v0_sdn-roadm-line_with_altered_initial_data/expected.json
@@ -1,4 +1,25 @@
{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "resource": [
+ "systemd-journal-upload.service"
+ ],
+ "alarm-type": [
+ {
+ "alarm-type-id": "velia-alarms:systemd-unit-failure",
+ "alarm-type-qualifier-match": ""
+ }
+ ],
+ "description": "Ignore systemd-journal-upload.service failures"
+ }
+ ]
+ }
+ }
+ },
"ietf-interfaces:interfaces": {
"interface": [
{
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/cmdline b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/cmdline
new file mode 100644
index 0000000..6b1d906
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/cmdline
@@ -0,0 +1 @@
+czechlight=sdn-roadm-line
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/expected.json b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/expected.json
new file mode 100644
index 0000000..29fcd4a
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/expected.json
@@ -0,0 +1,23 @@
+{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "resource": [
+ "systemd-journal-upload.service"
+ ],
+ "alarm-type": [
+ {
+ "alarm-type-id": "velia-alarms:systemd-unit-failure",
+ "alarm-type-qualifier-match": ""
+ }
+ ],
+ "description": "Ignore systemd-journal-upload.service failures"
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/startup.json b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/startup.json
new file mode 100644
index 0000000..2c63c08
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/startup.json
@@ -0,0 +1,2 @@
+{
+}
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/version b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/version
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/version
@@ -0,0 +1 @@
+2
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/xpath b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/xpath
new file mode 100644
index 0000000..68b9e92
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_empty_alarms/xpath
@@ -0,0 +1 @@
+/ietf-alarms:alarms
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/cmdline b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/cmdline
new file mode 100644
index 0000000..6b1d906
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/cmdline
@@ -0,0 +1 @@
+czechlight=sdn-roadm-line
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/expected.json b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/expected.json
new file mode 100644
index 0000000..29fcd4a
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/expected.json
@@ -0,0 +1,23 @@
+{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "resource": [
+ "systemd-journal-upload.service"
+ ],
+ "alarm-type": [
+ {
+ "alarm-type-id": "velia-alarms:systemd-unit-failure",
+ "alarm-type-qualifier-match": ""
+ }
+ ],
+ "description": "Ignore systemd-journal-upload.service failures"
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/startup.json b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/startup.json
new file mode 100644
index 0000000..c49d5e7
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/startup.json
@@ -0,0 +1,16 @@
+{
+ "ietf-alarms:alarms": {
+ "control": {
+ "alarm-shelving": {
+ "shelf": [
+ {
+ "name": "systemd journal upload",
+ "resource": [],
+ "alarm-type": [],
+ "description": "Something something something"
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/version b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/version
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/version
@@ -0,0 +1 @@
+2
diff --git a/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/xpath b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/xpath
new file mode 100644
index 0000000..68b9e92
--- /dev/null
+++ b/tests/czechlight-cfg-fs/data/v2_sdn-roadm-line_samename/xpath
@@ -0,0 +1 @@
+/ietf-alarms:alarms