You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/01/04 11:19:35 UTC
git commit: CIMI - test plan (resource metadata - The author of the
XSLT (Doug Davis ) agreed to licensing the stylesheet
http://wstf.org/docs/web/sc2html.xsl under the ASL 2.0
Updated Branches:
refs/heads/master 129943ea0 -> a09578bcf
CIMI - test plan (resource metadata - The author of the XSLT (Doug Davis <du...@us.ibm.com>) agreed to licensing the stylesheet http://wstf.org/docs/web/sc2html.xsl under the ASL 2.0
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a09578bc
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a09578bc
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a09578bc
Branch: refs/heads/master
Commit: a09578bcf16e391eebbe437ab934816e9cffbda8
Parents: 129943e
Author: Ronelle Landy <rl...@redhat.com>
Authored: Thu Jan 3 18:28:28 2013 -0500
Committer: marios <ma...@redhat.com>
Committed: Fri Jan 4 12:18:59 2013 +0200
----------------------------------------------------------------------
tests/cimi/plan/sc2html.xsl | 482 +++++++++++++++++++++++++
tests/cimi/plan/scRMD.xml | 739 ++++++++++++++++++++++++++++++++++++++
2 files changed, 1221 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a09578bc/tests/cimi/plan/sc2html.xsl
----------------------------------------------------------------------
diff --git a/tests/cimi/plan/sc2html.xsl b/tests/cimi/plan/sc2html.xsl
new file mode 100644
index 0000000..5e11c2e
--- /dev/null
+++ b/tests/cimi/plan/sc2html.xsl
@@ -0,0 +1,482 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<xsl:stylesheet version="1.0" exclude-result-prefixes="h w"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:h="http://www.w3.org/1999/xhtml"
+ xmlns:w="http://www.wstf.org">
+
+ <xsl:strip-space elements="*" />
+ <xsl:variable name="prereqName">Dependencies</xsl:variable>
+
+ <!--
+
+ Elements:
+
+ scenario - outer most element
+ metadata - contains info about the scenario
+ number - sc00x
+ title -
+ date -
+ status -
+
+ abstract - summary of scenario
+ section - sections are listed in the TOC
+ subsection - indented sub-section - it is numbered 1.2
+ subheading - non-indented sub-section - it is not numbered
+
+ scope -
+ technology -
+
+ timeline -
+ item -
+
+ namespaces -
+ namespace -
+
+ terms -
+ term -
+
+ operation -
+ action -
+ headers -
+ body -
+
+ exemplar -
+ xml -
+ populate -
+
+ note -
+ item -
+ num -
+ toggle - adds a toggle section
+
+ part -
+ group -
+ tests -
+ test -
+ desc -
+ description -
+ succ -
+ success -
+
+ changes -
+ change -
+
+ -->
+
+ <xsl:output method="html" encoding="utf-8" indent="yes"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
+ media-type="text/html" omit-xml-declaration="no" />
+
+ <xsl:template match="w:scenario">
+ <html>
+ <head>
+ <title>
+ <xsl:value-of select="w:metadata/w:number"/> -
+ <xsl:value-of select="w:metadata/w:title"/>
+ </title>
+ <xsl:if test="not(//w:metadata/w:nowstf)">
+ <link rel="SHORTCUT ICON"
+ href="http://www.wstf.org/images/wstf-ico.gif"
+ type="image/x-icon" />
+ </xsl:if>
+ <link href="http://www.wstf.org/docs/web/scen-v1.css" type="text/css"
+ rel="stylesheet"/>
+ <script type="text/javascript"
+ src="http://www.wstf.org/docs/web/scen-v1.js"/>
+ </head>
+ <body>
+ <!-- ========== Title Bar Info ========== -->
+ <xsl:if test="not(//w:metadata/w:nowstf)">
+ <img style="position:absolute;top:9px;left:9px;background-color:#d3d3d3"
+ onclick="window.location='http://www.wstf.org'"
+ src="http://www.wstf.org/images/wstf-small.gif"/>
+ </xsl:if>
+ <h1 style="padding-left:43px;padding-right:43px"> <!-- padding to avoid icon -->
+ <xsl:value-of select="w:metadata/w:number"/> -
+ <xsl:value-of select="w:metadata/w:title"/>
+ </h1>
+ <p class="date">Produced
+ <xsl:if test="not(//w:metadata/w:nowstf)">
+ by WSTF
+ </xsl:if>
+ : <xsl:value-of select="w:metadata/w:date"/>
+ </p>
+ <p class="status">Status:
+ <xsl:value-of select="w:metadata/w:status"/>
+ </p>
+
+ <xsl:apply-templates select="w:abstract"/>
+ <xsl:apply-templates select="w:timeline"/>
+
+ <!-- ========== TOC ========== -->
+ <xsl:if test="not(contains(//w:metadata/w:status,'Preview'))">
+ <h2>Table of Contents</h2>
+ <p>
+ <ol>
+ <xsl:for-each select="w:section">
+ <li><a href="#sec{position()}"><xsl:value-of select="@title"/></a></li>
+ </xsl:for-each>
+ </ol>
+ </p>
+ </xsl:if>
+
+ <!-- ========== Now process each section ========== -->
+ <xsl:apply-templates select="w:section"/>
+
+ <!-- ========== Add in some javascript ========== -->
+ <xsl:for-each select="//w:populate">
+ <script> populateFromURL( "<xsl:value-of select="generate-id(.)"/>", "<xsl:value-of select="@url"/>" ); </script>
+ </xsl:for-each>
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="w:abstract">
+ <h2>Abstract</h2>
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:template>
+
+ <xsl:template match="w:timeline">
+ <p>
+ <b>
+ <xsl:choose>
+ <xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
+ <xsl:otherwise>Timeline</xsl:otherwise>
+ </xsl:choose>
+ </b>
+ <br/>
+ <table class="mono" cellpadding="2" cellspacing="0">
+ <thead>
+ <tr>
+ <td>Start</td>
+ <td>End</td>
+ <td>Activity</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="w:item">
+ <tr>
+ <td><xsl:value-of select="@start"/></td>
+ <td><xsl:value-of select="@end"/></td>
+ <td><xsl:value-of select="@action"/></td>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </p>
+ </xsl:template>
+
+ <xsl:template match="w:terms">
+ <h4>Definitions</h4>
+ The following terms will be used throughout this scenario to refer
+ to the various factors that make up the individual tests.
+ <table class="" cellpadding="2" cellspacing="0">
+ <thead>
+ <tr>
+ <td>Term</td>
+ <td>Definition</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="w:term">
+ <tr>
+ <td><xsl:value-of select="@term"/></td>
+ <td><xsl:apply-templates/></td>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="w:scope">
+ <h4>Scope</h4>
+ Specifications, standards and technologies being tested:
+ <ul>
+ <xsl:for-each select="w:technology">
+ <li><a href="{@url}"><xsl:value-of select="@name"/></a></li>
+ </xsl:for-each>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="w:namespaces">
+ <h4>Namespaces</h4>
+ The following table defines the namespaces used in this document:
+ <table class="mono" cellpadding="2" cellspacing="0">
+ <thead>
+ <tr>
+ <td>Prefix</td>
+ <td>Namespace</td>
+ <td>Specification/Document</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="w:namespace">
+ <tr>
+ <td><xsl:value-of select="@prefix"/></td>
+ <td><xsl:value-of select="@ns"/></td>
+ <td><a href="{@ns}"><xsl:value-of select="@name"/></a></td>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <!-- ========== New Section ========== -->
+ <xsl:template match="w:section">
+ <h2>
+ <a name="sec{position()}">
+ <xsl:if test="not(contains(//w:metadata/w:status,'Preview'))">
+ <xsl:number format="1. "/>
+ </xsl:if>
+ <xsl:value-of select="@title"/>
+ </a>
+ </h2>
+ <p>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:template>
+
+ <xsl:template match="w:subheading">
+ <h4><xsl:value-of select="@title"/></h4>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="w:subsection">
+ <div style="margin-left:10px;margin-bottom:5px">
+ <h3>
+ <xsl:number format="1.1. " level="multiple" count="w:section|w:subsection"/><xsl:value-of select="@title"/>
+ </h3>
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="w:operation">
+ <h4 style="margin-top:5px"><u><xsl:value-of select="@name"/></u></h4>
+ <div style="margin:0;margin-left:0px">
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+ <!-- ===== Bullet item w/o indent ===== -->
+ <xsl:template match="w:note">
+ <ul style="margin-top:0;margin-bottom:0;padding-left:0em;margin-left:1em">
+ <li><xsl:apply-templates/></li>
+ </ul>
+ </xsl:template>
+
+ <!-- ===== Bullet item w/indent ===== -->
+ <xsl:template match="w:item">
+ <ul style="margin-top:0;margin-bottom:0">
+ <li><xsl:apply-templates/></li>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="w:num">
+ <xsl:variable name="nn" select="@group"/>
+ <xsl:if test="@group">
+ <xsl:variable name="num" select="1+count(preceding-sibling::w:num[@group=$nn])"/>
+ <ol start='{$num}' style="margin-top:0px;margin-bottom:0px">
+ <li><xsl:apply-templates/></li>
+ </ol>
+ </xsl:if>
+ <xsl:if test="not(@group)">
+ <xsl:variable name="num" select="1+count(preceding-sibling::w:num[not(@group)])"/>
+ <ol start='{$num}' style="margin-top:0px;margin-bottom:0px">
+ <li><xsl:apply-templates/></li>
+ </ol>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ===== Toggle/Popup ===== -->
+ <xsl:template match="w:toggle">
+ <xsl:variable name="num" select="1+count(preceding::w:toggle)"/>
+ <xsl:variable name="style" select="@style"/>
+ <a href="javascript:toggle('togDiv{$num}')"><xsl:value-of select="@title"/></a>
+ <div id="togDiv{$num}" onclick="javascript:toggle('togDiv{$num}')" style="display:block;visibility:hidden;height:0;{$style}">
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="w:popup">
+ <xsl:variable name="num" select="1+count(preceding::w:popup)"/>
+ <xsl:variable name="style" select="@style"/>
+ <a href="javascript:toggle('togDiv{$num}')"><xsl:value-of select="@title"/></a>
+ <div id="togDiv{$num}" style="border:2px ridge black;padding:2px;background-color:white;position:absolute;right:10px;display:block;visibility:hidden;height:0;{$style}">
+ <span style="background-color:white;border-top:2px ridge black;border-left:2px ridge black;border-right:2px ridge black;position:absolute;right:-2px;padding-left:1px;padding-right:1px;cursor:pointer;top:-18px" onclick="javascript:toggle('togDiv{$num}')"><b>CLOSE</b></span>
+ <xsl:apply-templates/>
+ </div>
+ </xsl:template>
+
+
+ <!-- ===== Snippet of XML ===== -->
+ <xsl:template match="w:xml">
+ <xsl:if test="@title">
+ <p style="margin:0"><tt><b><xsl:value-of select="@title"/>:</b></tt></p>
+ </xsl:if>
+ <pre class="ex" style="margin-bottom:0"><xsl:apply-templates/></pre>
+ </xsl:template>
+
+ <!-- ===== Pseudo code - soap message ===== -->
+ <xsl:template match="w:exemplar">
+ <xsl:if test="@type!=''">
+ <br/><tt><b><xsl:value-of select="@type"/>:</b></tt>
+ </xsl:if>
+ <pre class="ex" style="margin-bottom:0">
+ <p style="margin:0"><b>[Action]</b></p>
+ <xsl:if test="w:action">
+ <xsl:value-of select="w:action"/>
+ </xsl:if>
+
+ <p style="margin:0;padding-top:10px"><b>[Headers]</b></p>
+ <xsl:if test="w:headers">
+ <xsl:value-of select="w:headers"/>
+ </xsl:if>
+
+ <p style="margin:0;padding-top:10px"><b>[Body]</b></p>
+ <xsl:value-of select="w:body"/>
+ </pre>
+ </xsl:template>
+
+ <!-- Tests are grouped into 'parts'. Each part is a new # -->
+ <xsl:template match="w:part">
+ <p><b>Part <xsl:number level="single" count="w:part"/> -
+ <xsl:value-of select="@title"/></b><p/>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:template>
+
+ <!-- Within a part we can group tests -->
+ <xsl:template match="w:group">
+ <p><b><xsl:value-of select="@title"/></b><br/>
+ <xsl:apply-templates/>
+ </p>
+ </xsl:template>
+
+ <!-- ===== Tests are shown in table format ===== -->
+ <xsl:template match="w:tests">
+ <table class="mono" cellpadding="2" cellspacing="0">
+ <thead>
+ <tr>
+ <td width="4%">Number</td>
+ <td width="48%">Description</td>
+ <td width="48%">Success Criteria</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:apply-templates/>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="w:tests/w:test">
+ <tr>
+ <td>
+ <xsl:choose>
+ <xsl:when test="@num"><xsl:value-of select="@num"/></xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="ancestor::w:part">
+ <xsl:number level="single" count="w:part"/>
+ <xsl:text>.</xsl:text>
+ <xsl:number level="any" from="w:part" count="w:test"/>
+ </xsl:when>
+ <xsl:when test="not(ancestor::w:part)">
+ <xsl:number level="single" count="w:test"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ <td>
+ <xsl:if test="@name">
+ <b><xsl:value-of select="@name"/></b><br/>
+ </xsl:if>
+ <xsl:apply-templates select="w:description|w:desc"/>
+ </td>
+ <td>
+ <xsl:apply-templates select="w:success|w:succ"/>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="w:part/w:test">
+ <div style="margin-left:10px">
+ <b>
+ <xsl:choose>
+ <xsl:when test="@num"><xsl:value-of select="@num"/></xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="ancestor::w:part">
+ <xsl:number level="single" count="w:part"/>
+ <xsl:text>.</xsl:text>
+ <xsl:number level="any" from="w:part" count="w:test"/>
+ </xsl:when>
+ <xsl:when test="not(ancestor::w:part)">
+ <xsl:number level="single" count="w:test"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ - <xsl:value-of select="@name"/></b><br/>
+ <pre style="margin-top:0px;margin-bottom:0px"><xsl:apply-templates/></pre>
+ </div>
+ </xsl:template>
+
+ <!-- ========== Dynamically load XML files ========== -->
+ <xsl:template match="w:populate">
+ <div id="{generate-id(.)}"/>
+ </xsl:template>
+
+ <!-- ========== Change History Section ========== -->
+ <xsl:template match="w:changes">
+ <table class="mono" cellpadding="2" cellspacing="0">
+ <thead>
+ <tr>
+ <td>Date</td>
+ <td>Who</td>
+ <td>Change</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:for-each select="w:change">
+ <tr>
+ <td nowrap="1"><xsl:value-of select="@date"/></td>
+ <td nowrap="1"><xsl:value-of select="@who"/></td>
+ <td><xsl:apply-templates/></td>
+ </tr>
+ </xsl:for-each>
+ </tbody>
+ </table>
+ </xsl:template>
+
+ <!-- ========== Some Util Templates ========== -->
+
+ <!-- === Just blindly copy all unknown elements/attributes === -->
+ <xsl:template match="w:*" name="copy">
+ <xsl:element name="{local-name(.)}">
+ <xsl:for-each select="@*">
+ <xsl:copy/>
+ </xsl:for-each>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <!--
+ <xsl:template match="@*|node()" name="copy">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+ -->
+
+ <xsl:template name="echoXML">
+ <xsl:text><</xsl:text>
+ <xsl:value-of select="name(.)"/>
+ <xsl:text>></xsl:text>
+ </xsl:template>
+
+</xsl:stylesheet>
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a09578bc/tests/cimi/plan/scRMD.xml
----------------------------------------------------------------------
diff --git a/tests/cimi/plan/scRMD.xml b/tests/cimi/plan/scRMD.xml
new file mode 100644
index 0000000..c8a74e7
--- /dev/null
+++ b/tests/cimi/plan/scRMD.xml
@@ -0,0 +1,739 @@
+<?xml version="1.0" encoding="utf-8"?>
+<?xml-stylesheet type="text/xsl" href="file:sc2html.xsl" title="scenario"?>
+<scenario xmlns="http://www.wstf.org">
+
+ <metadata>
+ <number>Entity Metadata</number>
+ <title>Capabilities</title>
+ <date>2013/01/03</date>
+ <status>Draft</status>
+ <nowstf/>
+ </metadata>
+
+ <abstract>
+ These scenarios will test the Resource Metadata Capabilties as defined in the CIMI specification. Relevant spec quotes:
+
+ <item>
+ “Implementations of this specification SHOULD allow for
+Consumers to discover the metadata associated with each supported
+entity. Doing so allows for the discovery of Provider defined
+constraints on the CIMI defined attributes as well as discovery of
+any new extension attributes or operations that the Provider may have
+defined. EntityMetadata can also be used to express any Provider
+specific capabilities or features. The mechanism by which this
+metadata is made available will be protocol specific.”
+ </item>
+ <item> “ A set of Provider defined metadata that can be used by
+Consumer to discover any capability or feature provided by this
+Provider.”
+ </item>
+ <p/>
+ </abstract>
+
+ <section title="Dependencies">
+ <scope>
+ <technology name="CIMI" url="http://dmtf.org/sites/default/files/standards/documents/DSP0263_1.0.0.pdf"/>
+ </scope>
+
+ <namespaces>
+ <namespace prefix="cimi" ns="http://schemas.dmtf.org/cimi/1" name="CIMI"/>
+ <namespace prefix="xs" ns="http://www.w3.org/2001/XMLSchema"
+ name="XML Schema"/>
+ <namespace prefix="scRMD" ns="http://www.wstf.org/docs/scenarios/scRMD"
+ name="SCRMD (this scenario)"/>
+ </namespaces>
+ </section>
+
+ <section title="Testcases">
+ The testcases are ordered by:
+ <item>Resource Metadata Collection</item>
+ <item>Resource Metadata Entry within the collection</item>
+ <item>Capabilty/Attribute/Action associated with the Resource Metadata Entry</item>
+
+ <part title="Resource Metadata Collection">
+ <note> Test for the Resource Metadata collection. This test should only
+ be run once – not with every capability, attribute or action
+ tested. </note>
+ <tests>
+ <test name="Query the CEP">
+
+ <desc>
+ Consumer queries the CEP to determine the URLs
+ of the ResourceMetadata collection
+ </desc>
+
+ <succ>A serialization of a CEP is
+ returned. This test must adhere to the "Query the CEP"
+ test detailed in:
+ members.dmtf.org/apps/org/workgroup/vcmf/download.php/68964/cimiTest.html
+
+ <note> CEP.ReourceMetadata must be set </note>
+ <p/>
+
+ <popup title="Sample">
+ <xml>GET /CEP HTTP/1.1</xml>
+ <p/>
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+
+{ "resourceURI": "http://schemas.dmtf.org/cimi/1/CloudEntryPoint",
+ "id": "http://example.com/CEP",
+ "baseURI": "http://example.com/",
+ "resourceMetadata": { "href": "http://example.com/resourceMetadata" },
+ "machines": { "href": "http://example.com/machines" }
+}</xml>
+ </popup>
+
+ </succ>
+ </test>
+
+ <test name="Query the resource_metadata collection">
+ <desc>GET request is sent
+ to resource_metadata collection to query the metadata (attributes,
+ capabilities, actions) supported by the Cloud Provider. The
+ response can be returned in either format, XML or JSON.
+ </desc>
+
+ <succ>A representation of the resource_metadata collection is
+ returned – using either JSON or XML serialization.
+
+ <note> HTTP response code must be "200 OK" </note>
+ <note> Content-Type header must be either "application/json"
+ or "application/xml" </note>
+ <note> id must be set to the URL of the resource metadata
+ collection</note>
+ <note> resourceURI must be set to point to
+ ResourceMetadataCollection</note>
+ <note> count must match value the number of ResourceMetadata
+ elements returned</note>
+ <note> ResourceMetadata elements must be listed (if they exist
+ for the provider)</note>
+ <note> For each collection appearing in the
+ CEP there should be a ResourceMetadata entry with the corresponding typeURI in the
+ ResourceMetadata collection </note>
+ <note> Capabilities, attributes and actions available on the
+ provider must be listed. The entries are returned within
+ ResourceMetadata elements related to the collections they are
+ associated with</note>
+
+ <p/>
+
+ <popup title="Sample">
+ <xml>GET /CEP HTTP/1.1
+Accept: application/json</xml>
+ <p/>
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+
+{"count": 1,
+ "resourceURI": "http://schemas.dmtf.org/cimi/1/ResourceMetadataCollection",
+ "resourceMetadata":
+ [{"capabilities":
+ [{"uri":"http://schemas.dmtf.org/cimi/1/capability/Collection/Capability1", "description":"Description of Capability 1", "name":"Capability1", "value":"valueOfCapability1"},
+ {"uri":"http://schemas.dmtf.org/cimi/1/capability/Collection/Capability2", "description":"Description of Capability 2", "name":"Capability2", "value":"valueOfCapability2A, valueOfCapability2B"}],
+ "typeUri": "http://schemas.dmtf.org/cimi/1/Collection",
+ "name": "Collection",
+ "id": "http://example.com/cimi/resource_metadata/collection"}],
+ "id":"http://example.com/cimi/resource_metadata"
+}
+ </xml>
+ </popup>
+
+ </succ>
+ </test>
+
+ </tests>
+ </part>
+
+<part title="Machines Resource Metadata">
+ <note>
+ This test only applies if CEP.machines is present.
+ </note>
+ <tests>
+ <test name="Query the resource_metadata collection">
+ <desc> GET request is sent to resource_metadata collection to query the metadata associated
+ with the 'Machine' entry
+ </desc>
+
+ <succ>A representation of the resource_metadata collection is
+ returned – using either JSON or XML serialization.
+
+ <note> HTTP response code must be "200 OK" </note>
+ <note>ResourceMetadata.id must be set </note>
+ <note> ResourceMetadata.name must be set to Machine </note>
+ <note> ResourceMetadata.typeUri must be set </note>
+ <note> Capabilities, attributes and actions available on the
+ provider that are associated with the Machine collection must be
+ listed </note>
+
+ <p/>
+
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+
+{
+"count": 1,
+"resourceURI": "http://schemas.dmtf.org/cimi/1/ResourceMetadataCollection",
+"resourceMetadata":
+ [{"capabilities":
+ [{"uri":"http://schemas.dmtf.org/cimi/1/capability/Machine/Capability1", "description":"Decsription of Capability 1", "name":"Capability1", "value":"valueOfCapability1"},
+ {"uri":"http://schemas.dmtf.org/cimi/1/capability/Machine/capability2", "description":"Description of Capability 2", "name":"Capability2", "value":"valueOfCapability2A, valueOfCapability2B"}],
+ "typeUri":"http://schemas.dmtf.org/cimi/1/Machine",
+ "name":"Machine",
+ "id":"http://example.com/cimi/resource_metadata/machine"}],
+"id":"http://example.com/cimi/resource_metadata"
+}
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Query the ResourceMetadata entry">
+ <desc> Issue a specific GET
+ request to return the capabilities, attributes and actions
+ associated with the Machine ResourceMetadata entry only
+ </desc>
+
+ <succ>
+ <note> HTTP response code must be "200 OK". </note>
+ <note> Each capability, attribute and action advertised must contain:
+ <note> name </note>
+ <note> uri (unique)</note>
+ <note> description </note>
+ <note> value </note>
+ </note>
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+
+{
+"capabilities":
+ [{"uri": "http://schemas.dmtf.org/cimi/1/capability/Machine/Capability1",
+ "description": "Description of Capability 1",
+ "name": "Capability1",
+ "value": "valueOfCapability1"},
+ {"uri": "http://schemas.dmtf.org/cimi/1/capability/Machine/Capability2",
+ "description": "Description of Capability 2",
+ "name": "Capability2",
+ "value": "valueOfCapability2A, valueOfCapability2B"}],
+"typeUri": "http://schemas.dmtf.org/cimi/1/Machine",
+"name": "Machine",
+"resourceURI": "http://schemas.dmtf.org/cimi/1/ResourceMetadata",
+"id": "http://example.com/cimi/resource_metadata/machine"
+}
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ </tests>
+
+ </part>
+
+<part title="Default Initial State – Machine Capability">
+ <tests>
+ <test name="Query the ResourceMetadata entry">
+ <desc>
+ Consumer queries Machine
+ ResourceMetadata to find the DefaultInitialState capability
+ </desc>
+
+ <succ>
+ A serialization of the resource_metadata collection is returned
+ – using either JSON or XML serialization. This test must adhere
+ to one of the "Query the ResourceMetadata entry" tests in
+ the previous section.
+
+ <note> The DefaultInitialState capability must be returned </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/xml
+
+<ResourceMetadata xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/ResourceMetadata">
+<id>http://example.com/cimi/resource_metadata/machine</id>
+<name>Machine</name>
+<typeUri>http://schemas.dmtf.org/cimi/1/Machine</typeUri>
+<capability name="DefaultInitialState" uri="http://schemas.dmtf.org/cimi/1/capability/Machine/DefaultInitialState" description="Indicates what the default initial state of a new Machine">STARTED</capability>
+</ResourceMetadata>
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+
+ <test name="Inspect the capability">
+ <desc> Use the GET request from above to
+ return the all information available about the capability.
+ </desc>
+
+ <succ>The capability advertised must contain:
+ <note> name </note>
+ <note> uri (unique)</note>
+ <note> description </note>
+ <note> a single value </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+
+{
+"capabilities":
+ [{"name": "DefaultInitialState",
+ "value": "STARTED",
+ "description": "Indicates what the default initial state of a new Machine",
+ "uri": "http://schemas.dmtf.org/cimi/1/capability/Machine/DefaultInitialState"}],
+"typeUri": "http://schemas.dmtf.org/cimi/1/Machine",
+"name": "Machine",
+"resourceURI": "http://schemas.dmtf.org/cimi/1/ResourceMetadata",
+"id": "http://example.com/cimi/resource_metadata/machine"
+}
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Put collection member in state to verify capability">
+ <desc>
+ Create a
+ new machine using either a single machineTemplate or a
+ machineImage and a machineConfig – without specifying a desired
+ initial state
+ </desc>
+
+
+ <succ>
+ The response returned must adhere to the success criteria
+ described in
+ members.dmtf.org/apps/org/workgroup/vcmf/download.php/68964/cimiTest.html
+ (Creating a new Machine section)
+
+ <note> HTTP response code must be "201 Created" </note>
+ <note> The state reported by the response to the 'create machine'
+ operation might be a 'PENDING', 'CREATING' or other intermediate
+ state before the machine can be placed into a stable initial
+ state.</note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>POST /machines HTTP/1.1
+Content-Type: application/json
+
+{ "resourceURI": "http://schemas.dmtf.org/cimi/1/MachineCreate",
+ "name": "machineDefaultInitialState",
+ "description": "Machine to test the default initial state",
+ "machineTemplate": {
+ "machineConfig": { "href": " http://example.com/machine_configurations/small" },
+ "machineImage": { "href": " http://example.com/machine_images/img2" },
+ "credential": { "href": "http://example.com/creds/12345" }
+ }
+}
+
+<hr/>HTTP/1.1 201 Created
+Location: http://example.com/machines/machineId12345
+</xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Execute a query/action to expose the capability">
+ <desc>
+ Execute a
+ GET /machines/new_machine_id operation to return the
+ machine stable initial state
+ </desc>
+
+ <succ>
+ <note> HTTP response code must be "200 OK" </note>
+ <note> The state reported by the response to the GET operation
+ might be a 'PENDING', 'CREATING' or other intermediate state
+ before the machine can be placed into a stable initial state. If
+ an intermediate state is returned, poll for the machine state to
+ change to a stable initial state </note>
+ <note> After the machine is in a stable initial state, the value
+ returned in the STATE entry of the response must match the value
+ advertised in the DefaultInitialState capability </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+
+{ "resourceType": "http://schemas.dmtf.org/cimi/1/Machine",
+ "id": "http://example.com/machines/machineId12345",
+ "name": "machineDefaultInitialState",
+ "description": "Machine to test the default initial state",
+ "created": "2013-01-02T10:04:00Z",
+ "updated": "2013-01-22T10:04:00Z",
+ "state": "STARTED",
+ "cpu": "1",
+ "memory": 10485760,
+ "disks" : { "href": "http://example.com/machines/machineId12345/disks",
+ "volumes": { "href": "http://example.com/machines/machineId12345/volumes" },
+ "networkInterfaces": { "href": "http://example.com/machines/machineId12345/NIs",
+ "operations": [
+ { "rel": "http://schemas.dmtf.org/cimi/1/action/capture", "href": "http://example.com/cimi/machine_images" },
+ { "rel": "http://schemas.dmtf.org/cimi/1/action/stop", "href": "http://example.com/machines/machineId12345/stop" }
+ ]
+}
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Cleanup">
+ <desc>
+ (STOP and) DELETE the machine created in test above
+ </desc>
+
+ <succ>
+
+ <note> HTTP response code must be one of (200-207) </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ </tests>
+
+ </part>
+
+
+ <part title="Initial States – Machine Capability">
+ <tests>
+ <test name="Query the ResourceMetadata entry">
+ <desc>
+ Consumer queries Machine
+ ResourceMetadata to find the InitialStates capability
+ </desc>
+
+ <succ>
+ A serialization of the resource_metadata collection is returned
+ – using either JSON or XML serialization. This test must adhere
+ to one of the "Query the ResourceMetadata entry" test in
+ the section.
+
+ <note>The InitialStates capability must be returned </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+
+{
+"capabilities":
+ [{"name": "InitialStates",
+ "value": "STARTED,STOPPED",
+ "description": "Indicates the list of allowable initial states",
+ "uri": "http://schemas.dmtf.org/cimi/1/capability/Machine/InitialStates"}],
+"typeUri": "http://schemas.dmtf.org/cimi/1/Machine",
+"name": "Machine",
+"resourceURI": "http://schemas.dmtf.org/cimi/1/ResourceMetadata",
+"id": "http://example.com/cimi/resource_metadata/machine"
+}
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+
+ <test name="Inspect the capability">
+ <desc>
+ Use the GET request from above to
+ return the all information available about the capability.
+ </desc>
+
+ <succ>
+ The capability advertised must contain:
+ <note> name </note>
+ <note> uri (unique)</note>
+ <note> description </note>
+ <note> value(s) </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/xml
+
+<ResourceMetadata xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/ResourceMetadata">
+<id>http://example.com/cimi/resource_metadata/machine</id>
+<name>Machine</name>
+<typeUri>http://schemas.dmtf.org/cimi/1/Machine</typeUri>
+<capability name="InitialStates" uri="http://schemas.dmtf.org/cimi/1/capability/Machine/InitialStates" description="Indicates the list of allowable initial states">STARTED,STOPPED</capability>
+</ResourceMetadata>
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Put collection member in state to verify capability">
+ <desc>
+ Create a
+ new machine using either a single machineTemplate or a
+ machineImage and a machineConfig – specifying a desired initial
+ state which is different from the default value (see
+ DefaultInitalState capability)
+ </desc>
+
+ <succ>
+ The response returned must adhere to the success criteria
+ described in
+ members.dmtf.org/apps/org/workgroup/vcmf/download.php/68964/cimiTest.html
+ (Creating a new Machine section)
+
+ <note> HTTP response code must be "201 Created" </note>
+ <note> The state reported by the response to the 'create machine'
+ operation might be a 'PENDING', 'CREATING' or other intermediate
+ state before the machine can be placed into a stable initial
+ state. </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>POST /machines HTTP/1.1
+Content-Type: application/json
+
+{ "resourceURI": "http://schemas.dmtf.org/cimi/1/MachineCreate",
+ "name": "machineInitialStateStopped",
+ "description": "Machine to test initial states",
+ "machineTemplate": {
+ "initialState": "STOPPED"
+ "machineConfig": { "href": "http://example.com/machine_configurations/small" },
+ "machineImage": { "href": "http://example.com/machine_images/img2" },
+ "credential": { "href": "http://example.com/creds/12345" }
+ }
+}
+<hr/>HTTP/1.1 201 Created
+Location: http://example.com/machines/machineId123456
+
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Execute a query/action to expose the capability">
+ <desc>
+ Execute a
+ GET /machines/new machine id operation to return the
+ machine stable initial state
+ </desc>
+
+ <succ>
+
+ <note> HTTP response code must be "200 OK" </note>
+ <note> The state reported by the response to the GET operation
+ might be a 'PENDING', 'CREATING' or other intermediate state
+ before the machine can be placed into a stable initial state. If
+ an intermediate state is returned, poll for the machine state to
+ change to a stable initial state </note>
+ <note> After the machine is in a stable initial state, the value
+ returned in the STATE entry of the response must match the value
+ specified when the machine was created in test step above </note>
+ <note> The machine response must advertise operations that match
+ the state initial stable state (for example, a machine created
+ with a STOPPED initial state should advertise 'start' as an
+ available operation) </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>TTP/1.1 200 OK
+Content-Type: application/json
+
+{ "resourceType": "http://schemas.dmtf.org/cimi/1/Machine",
+ "id": "http://example.com/machines/machineId123456",
+ "name": "machineInitialStateStopped",
+ "description": "Machine to test initial states",
+ "created": "2013-01-02T11:04:00Z",
+ "updated": "2013-01-22T11:04:00Z",
+ "state": "STOPPED",
+ "cpu": "1",
+ "memory": 10485760,
+ "disks" : { "href": "http://example.com/machines/machineId123456/disks",
+ "volumes": { "href": "http://example.com/machines/machineId123456/volumes" },
+ "networkInterfaces": { "href": "http://example.com/machines/machineId123456/NIs",
+ "operations": [
+ { "rel": "http://schemas.dmtf.org/cimi/1/action/capture", "href": "http://example.com/cimi/machine_images" },
+ { "rel": "http://schemas.dmtf.org/cimi/1/action/start", "href": "http://example.com/machines/machineId123456/start" }
+ ]
+}
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Cleanup">
+ <desc>
+ (STOP and) DELETE the machine created.
+ </desc>
+
+ <succ>
+ <note> HTTP response code must be one of (200-207) </note>
+
+ <p/>
+ <popup title="Sample">
+ <xml>HTTP/1.1 200 OK
+Content-Type: application/json
+ </xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Repeat the test for initial states advertised (if there are
+ more states to test)">
+ <desc>
+ Repeat steps to exercise and
+ verify the responses when a machine is created with each of the
+ possible initial states advertised in the capability.
+
+ <note> This test only applies if their are more than one InitialStates. </note>
+ </desc>
+
+ <succ>
+ The output results should adhere to the success criteria
+ specified for each step – making adjustments relative to the
+ initial state under test.
+ </succ>
+ </test>
+
+ </tests>
+
+ </part>
+
+
+
+ <part title="General case - test case template per capability/action/attribute">
+ <tests>
+ <test name="Query the resource_metadata collection">
+ <desc>
+ GET request is sent
+ to resource_metadata collection to query the metadata associated
+ with the relevant collection
+ </desc>
+
+ <succ>
+ A representation of the resource_metadata collection is
+ returned – using either JSON or XML serialization
+
+ <note> HTTP response code must be "200 OK" </note>
+ <note> Content-Type header must be either "application/json"
+ or "application/xml" </note>
+ <note> id must be set to the URL of the resource metadata
+ collection </note>
+ <note> resourceURI must be set to point to
+ ResourceMetadataCollection </note>
+ <note> count must match value the number of ResourceMetadata
+ elements returned </note>
+
+ <p/>
+
+ <popup title="Sample">
+ <xml></xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Inspect the capability">
+ <desc>
+ Use the GET request from above or
+ issue a specific GET request to return the all information
+ available about the capability.
+ </desc>
+
+ <succ>
+ Each capability advertised must contain:
+ <note> name </note>
+ <note> uri (unique)</note>
+ <note> description </note>
+ <note> value </note>
+
+ <p/>
+
+ <popup title="Sample">
+ <xml></xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Put collection member in state to verify capability">
+ <desc>
+ Generally
+ a POST (or PUT/DELETE) request to place the collection member in a
+ state to operate on the capability.
+ </desc>
+
+ <succ>
+ The collection member will contain an attribute or advertise an
+ action in support of the capability under test. The return code
+ will depend on the request performed.
+
+ <p/>
+
+ <popup title="Sample">
+ <xml></xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Execute a query/action to expose the capability">
+ <desc>
+ GET or POST/PUT request that exercises the capability.
+ </desc>
+
+ <succ>
+ The collection member exhibits the behaviour advertised by the
+ capability. If the particular capability is not yet supported, the
+ request returns XXX.
+
+ <p/>
+
+ <popup title="Sample">
+ <xml></xml>
+ </popup>
+ </succ>
+ </test>
+
+ <test name="Cleanup">
+ <desc>
+ DELETE/POST/other actions to reverse any state
+ changes and remove any additional artifacts created in steps above.
+ </desc>
+
+ <succ>
+ The collection member is returned to its initial state before
+ the test and all artifacts created during the test are
+ reverted/removed.
+
+ <p/>
+
+ <popup title="Sample">
+ <xml></xml>
+ </popup>
+ </succ>
+ </test>
+ </tests>
+
+ </part>
+ </section>
+
+ <section title="Findings">
+ <num>
+
+ </num>
+ </section>
+
+ <section title="Change History">
+ <changes>
+ <change date="2013/01/03" who="Ronelle Landy">Initial Draft</change>
+ </changes>
+ </section>
+
+</scenario>
+