pdmgen: Require uppercase meta keys

journald ignores lowercase metadata keys so require them
to be uppercase.  Abort the config file parse when lowercase
keys are found.

Change-Id: Icffffdc6680b4d305329c3395f8e2fda6210964f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/src/example/example.yaml b/src/example/example.yaml
index 899c4c8..6a1685f 100644
--- a/src/example/example.yaml
+++ b/src/example/example.yaml
@@ -18,13 +18,13 @@
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst1
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst2
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst3
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
 
 - name: example property group
@@ -39,10 +39,10 @@
   type: uint32
   members:
     - interface: xyz.openbmc_project.Sensor.Value
-      meta: property
+      meta: PROPERTY
       property: ValueA
     - interface: xyz.openbmc_project.Sensor.Value
-      meta: property
+      meta: PROPERTY
       property: ValueB
 
 - name: example property watch
diff --git a/src/pdmgen.py b/src/pdmgen.py
index 5e88e2c..d878500 100755
--- a/src/pdmgen.py
+++ b/src/pdmgen.py
@@ -221,6 +221,12 @@
     def __init__(self, *a, **kw):
         super(Path, self).__init__(**kw)
 
+        if self.name['meta'].upper() != self.name['meta']:
+            raise InvalidConfigError(
+                self.configfile,
+                'Metadata tag "{0}" must be upper case.'.format(
+                    self.name['meta']))
+
     def factory(self, objs):
         '''Create path and metadata elements.'''
 
@@ -259,6 +265,12 @@
     def __init__(self, *a, **kw):
         super(Property, self).__init__(**kw)
 
+        if self.name['meta'].upper() != self.name['meta']:
+            raise InvalidConfigError(
+                self.configfile,
+                'Metadata tag "{0}" must be upper case.'.format(
+                    self.name['meta']))
+
     def factory(self, objs):
         '''Create interface, property name and metadata elements.'''
 
diff --git a/src/test/pathgentest.cpp b/src/test/pathgentest.cpp
index 2199182..d13c82e 100644
--- a/src/test/pathgentest.cpp
+++ b/src/test/pathgentest.cpp
@@ -11,9 +11,9 @@
 
 const std::array<std::string, 3> expectedMeta =
 {
-    "path1"s,
-    "path3"s,
-    "path2"s,
+    "PATH1"s,
+    "PATH3"s,
+    "PATH2"s,
 };
 
 const std::array<std::string, 6> expectedPaths =
diff --git a/src/test/propertygentest.cpp b/src/test/propertygentest.cpp
index cf32191..e5c95c2 100644
--- a/src/test/propertygentest.cpp
+++ b/src/test/propertygentest.cpp
@@ -17,9 +17,9 @@
 #include "propertygentest.hpp"
 const std::array<std::string, 3> expectedMeta =
 {
-    "property1"s,
-    "property2"s,
-    "property3"s,
+    "PROPERTY1"s,
+    "PROPERTY2"s,
+    "PROPERTY3"s,
 };
 
 const std::array<std::string, 4> expectedInterfaces =
diff --git a/src/test/yaml/callbackgentest/one.yaml b/src/test/yaml/callbackgentest/one.yaml
index e94b262..fa2b814 100644
--- a/src/test/yaml/callbackgentest/one.yaml
+++ b/src/test/yaml/callbackgentest/one.yaml
@@ -7,16 +7,16 @@
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
 
 - name: test path group 2
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst6
 
 - name: test property group 1
@@ -25,7 +25,7 @@
   type: int32
   members:
     - interface: xyz.openbmc_project.Sensor.Iface1
-      meta: property
+      meta: PROPERTY
       property: Value
 
 - name: test property group 2
@@ -34,7 +34,7 @@
   type: string
   members:
     - interface: xyz.openbmc_project.Sensor.Iface3
-      meta: property
+      meta: PROPERTY
       property: Value2
 
 - name: test journal callback 1
diff --git a/src/test/yaml/callbackgentest/two.yaml b/src/test/yaml/callbackgentest/two.yaml
index 6037f43..1f61e3b 100644
--- a/src/test/yaml/callbackgentest/two.yaml
+++ b/src/test/yaml/callbackgentest/two.yaml
@@ -4,9 +4,9 @@
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst6
 
 - name: test property group 1
@@ -15,7 +15,7 @@
   type: string
   members:
     - interface: xyz.openbmc_project.Sensor.Iface3
-      meta: property
+      meta: PROPERTY
       property: Value2
 
 - name: test journal callback 1
diff --git a/src/test/yaml/callbackgroupgentest/test.yaml b/src/test/yaml/callbackgroupgentest/test.yaml
index 03962ba..91a4923 100644
--- a/src/test/yaml/callbackgroupgentest/test.yaml
+++ b/src/test/yaml/callbackgroupgentest/test.yaml
@@ -4,16 +4,16 @@
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
 
 - name: test path group 2
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst6
 
 - name: test property group 1
@@ -22,7 +22,7 @@
   type: int32
   members:
     - interface: xyz.openbmc_project.Sensor.Iface1
-      meta: property
+      meta: PROPERTY
       property: Value
 
 - name: test property group 2
@@ -31,7 +31,7 @@
   type: string
   members:
     - interface: xyz.openbmc_project.Sensor.Iface3
-      meta: property
+      meta: PROPERTY
       property: Value2
 
 - name: test journal callback 1
diff --git a/src/test/yaml/conditiongentest/test.yaml b/src/test/yaml/conditiongentest/test.yaml
index 0444d55..870877a 100644
--- a/src/test/yaml/conditiongentest/test.yaml
+++ b/src/test/yaml/conditiongentest/test.yaml
@@ -4,16 +4,16 @@
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
 
 - name: test path group 2
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst6
 
 - name: test property group 1
@@ -22,7 +22,7 @@
   type: int32
   members:
     - interface: xyz.openbmc_project.Sensor.Iface1
-      meta: property
+      meta: PROPERTY
       property: Value
 
 - name: test property group 2
@@ -31,7 +31,7 @@
   type: string
   members:
     - interface: xyz.openbmc_project.Sensor.Iface3
-      meta: property
+      meta: PROPERTY
       property: Value2
 
 - name: test count condition 1
diff --git a/src/test/yaml/pathgentest/groupone.yaml b/src/test/yaml/pathgentest/groupone.yaml
index a4d5b57..7985b47 100644
--- a/src/test/yaml/pathgentest/groupone.yaml
+++ b/src/test/yaml/pathgentest/groupone.yaml
@@ -5,24 +5,24 @@
   class: group
   group: path
   members:
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst1
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst2
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst3
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst4
 
 - name: test path group 2
   class: group
   group: path
   members:
-    - meta: path3
+    - meta: PATH3
       path: /xyz/openbmc_project/testing/inst1
-    - meta: path3
+    - meta: PATH3
       path: /xyz/openbmc_project/testing/inst2
-    - meta: path3
+    - meta: PATH3
       path: /xyz/openbmc_project/testing/inst3
-    - meta: path3
+    - meta: PATH3
       path: /xyz/openbmc_project/testing/inst4
diff --git a/src/test/yaml/pathgentest/grouptwo.yaml b/src/test/yaml/pathgentest/grouptwo.yaml
index 911211e..3910fd2 100644
--- a/src/test/yaml/pathgentest/grouptwo.yaml
+++ b/src/test/yaml/pathgentest/grouptwo.yaml
@@ -7,24 +7,24 @@
   class: group
   group: path
   members:
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst1
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst2
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst5
-    - meta: path1
+    - meta: PATH1
       path: /xyz/openbmc_project/testing/inst6
 
 - name: test path group 2
   class: group
   group: path
   members:
-    - meta: path2
+    - meta: PATH2
       path: /xyz/openbmc_project/testing/inst4
-    - meta: path2
+    - meta: PATH2
       path: /xyz/openbmc_project/testing/inst3
-    - meta: path2
+    - meta: PATH2
       path: /xyz/openbmc_project/testing/inst2
-    - meta: path2
+    - meta: PATH2
       path: /xyz/openbmc_project/testing/inst1
diff --git a/src/test/yaml/propertygentest/groupone.yaml b/src/test/yaml/propertygentest/groupone.yaml
index 9ab9ace..5837e72 100644
--- a/src/test/yaml/propertygentest/groupone.yaml
+++ b/src/test/yaml/propertygentest/groupone.yaml
@@ -5,10 +5,10 @@
   members:
     - interface: xyz.openbmc_project.Test.Iface3
       property: Foo
-      meta: property1
+      meta: PROPERTY1
     - interface: xyz.openbmc_project.Test.Iface2
       property: Value
-      meta: property2
+      meta: PROPERTY2
 
 - name: test property group 2
   class: group
@@ -17,7 +17,7 @@
   members:
     - interface: xyz.openbmc_project.Test.Iface3
       property: Bar
-      meta: property1
+      meta: PROPERTY1
     - interface: xyz.openbmc_project.Test.Iface2
       property: Foo
-      meta: property2
+      meta: PROPERTY2
diff --git a/src/test/yaml/propertygentest/grouptwo.yaml b/src/test/yaml/propertygentest/grouptwo.yaml
index 4f2db02..9b86bba 100644
--- a/src/test/yaml/propertygentest/grouptwo.yaml
+++ b/src/test/yaml/propertygentest/grouptwo.yaml
@@ -5,10 +5,10 @@
   members:
     - interface: xyz.openbmc_project.Test.Iface6
       property: Foo
-      meta: property1
+      meta: PROPERTY1
     - interface: xyz.openbmc_project.Test.Iface1
       property: Value
-      meta: property2
+      meta: PROPERTY2
 
 - name: test property group 3
   class: group
@@ -17,10 +17,10 @@
   members:
     - interface: xyz.openbmc_project.Test.Iface3
       property: Bar
-      meta: property1
+      meta: PROPERTY1
     - interface: xyz.openbmc_project.Test.Iface2
       property: Value
-      meta: property2
+      meta: PROPERTY2
     - interface: xyz.openbmc_project.Test.Iface6
       property: Baz
-      meta: property3
+      meta: PROPERTY3
diff --git a/src/test/yaml/propertywatchgentest/watchone.yaml b/src/test/yaml/propertywatchgentest/watchone.yaml
index bea2b09..1e6f7b4 100644
--- a/src/test/yaml/propertywatchgentest/watchone.yaml
+++ b/src/test/yaml/propertywatchgentest/watchone.yaml
@@ -2,26 +2,26 @@
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst1
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst2
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst3
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
 
 - name: test path group 2
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst3
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst5
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst6
 
 - name: test property group 1
@@ -30,10 +30,10 @@
   type: string
   members:
     - interface: xyz.openbmc_project.Sensor.Iface1
-      meta: property
+      meta: PROPERTY
       property: Value
     - interface: xyz.openbmc_project.Sensor.Iface2
-      meta: property
+      meta: PROPERTY
       property: Value
 
 - name: test property group 2
@@ -42,10 +42,10 @@
   type: uint32
   members:
     - interface: xyz.openbmc_project.Sensor.Iface3
-      meta: property
+      meta: PROPERTY
       property: Value1
     - interface: xyz.openbmc_project.Sensor.Iface3
-      meta: property
+      meta: PROPERTY
       property: Value2
 
 - name: test property watch 1
diff --git a/src/test/yaml/propertywatchgentest/watchtwo.yaml b/src/test/yaml/propertywatchgentest/watchtwo.yaml
index 0f5ebdc..8b3dfcf 100644
--- a/src/test/yaml/propertywatchgentest/watchtwo.yaml
+++ b/src/test/yaml/propertywatchgentest/watchtwo.yaml
@@ -2,16 +2,16 @@
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
 
 - name: test path group 3
   class: group
   group: path
   members:
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst4
-    - meta: path
+    - meta: PATH
       path: /xyz/openbmc_project/testing/inst6
 
 - name: test property group 1
@@ -20,7 +20,7 @@
   type: int32
   members:
     - interface: xyz.openbmc_project.Sensor.Iface1
-      meta: property
+      meta: PROPERTY
       property: Value
 
 - name: test property group 3
@@ -29,7 +29,7 @@
   type: string
   members:
     - interface: xyz.openbmc_project.Sensor.Iface3
-      meta: property
+      meta: PROPERTY
       property: Value2
 
 - name: test property watch 1