User:Infinity Linden/OGP Test Cases

From Second Life Wiki
Jump to navigation Jump to search

note: this is a brief note for informational purposes. it's eventually going to be "cleaned up" and moved to a more appropriate place on this wiki.

Introduction

What is This?

In the development of the Open Grid Protocol and the PyOGP project, it became obvious that there were no canonical lists of use cases and things to test. This page is the first effort to remediate this omission. While we don't go as far as providing use cases here, we do list common functionality and interoperability tests.

About the OGP Test Cases

The objective of the Open Grid Protocol is to specify syntax and semantics of SL Grid messages to the degree that interoperable viewers, agent domains, region domains and regions may be coded without resort to close examination of open source code from Linden Lab or peeking into the interaction between running clients and servers. The Second Life Grid has been developed sufficiently, the reasoning goes, that it should be possible to shine the bright light of inquiry on the process and document the living heck out of how the system works. Moving forward we should see advantages as software developers code to documented requirements and standards. The "OGP Test Cases" are a catalog of tests that demonstrate compatibility with the written spec.

Well... that's how it's supposed to be... In the real world, "running code" trumps written specifications, and probably will continue to do so. And that's one of the reasons we have the interop tests; properly written test cases succinctly communicate abstractions introduced in written specifications. So rather than viewing the SLGOGP spec and these tests as separate, think of them as being two sections of the same document.

Test Fixtures

Login Test Fixtures

0. login host fixtures
This is the "stock" login host for initial OGP beta roll-out. This is the host which receives authentication requests.
0. login.aditi.lindenlab.com
1. agent domain fixtures
This is the "stock" agent domain host for initial OGP beta roll-out. This machine hosts capabilities granted after successful authentication.
0. agent0.aditi.lindenlab.com
2. region fixtures
These are two "well defined regions" within Linden Lab's beta test grid. Note there are no "well defined regions" outside Linden Lab's administrative domain. Anyone want to add themselves to the list? OSGrid? Bueller?
0. sim1.vaak.lindenlab.com:13000
1. sim1.vaak.lindenlab.com:13001
3. agents
There are currently 32 "standard" agents for testing. The agents represent all combinations of the five factors: accepted TOS, read critical messages, high or low god level, suspended and disabled.
fixture first name last name accepted TOS read critical messages god level suspended disabled
0. Arthur Crimthande True True 150 True True
1. Bertha Crimthande False True 150 True True
2. Cristobal Crimthande True False 150 True True
3. Dolly Crimthande False False 150 True True
4. Edouard Crimthande True True 0 True True
5. Fay Crimthande False True 0 True True
6. Gustav Crimthande True False 0 True True
7. Hanna Crimthande False False 0 True True
8. Ana Crimthande True True 150 False True
9. Bill Crimthande False True 150 False True
10. Claudette Crimthande True False 150 False True
11. Danny Crimthande False False 150 False True
12. Erika Crimthande True True 0 False True
13. Fred Crimthande False True 0 False True
14. Grace Crimthande True False 0 False True
15. Henri Crimthande False False 0 False True
16. Alex Crimthande True True 150 True False
17. Bonnie Crimthande False True 150 True False
18. Colin Crimthande True False 150 True False
19. Danielle Crimthande False False 150 True False
20. Earl Crimthande True True 0 True False
21. Fiona Crimthande False True 0 True False
22. Gaston Crimthande True False 0 True False
23. Hermine Crimthande False False 0 True False
24. Arlene Crimthande True True 150 False False
25. Bret Crimthande False True 150 False False
26. Cindy Crimthande True False 150 False False
27. Don Crimthande False False 150 False False
28. Emily Crimthande True True 0 False False
29. Franklin Crimthande False True 0 False False
30. Gert Crimthande True False 0 False False
31. Harvey Crimthande False False 0 False False



4. accounts
The SLGOGP specification describes the concept of an "account" as distinct from an "agent". Accounts may have distinct names and login credentials. Additionally, users may use the account credentials to authenticate themselves to the agent domain in the login process. At the current time, this functionality is not deployed to the Aditi grid.
5. faux machines
These are used to test machines blacklisted by mac address or id0
0. machine whose mac address and id0 are not blacklisted
1. machine whose mac address is blacklisted and id0 is not blacklisted
2. machine whose mac address is not blacklisted and id0 is blacklisted
3. machine whose mac address and id0 are blacklisted
6. blacklisted id0s
These are the id0s the agent domain under test should consider as being blacklisted
0. 4EahsGwT/GYg9uBSQeKcNA==
1. 07BzhNET7exJ6qYjitX/AA==
7. blacklisted mac addresses
These are the mac addresses the agent domain under test should consider as being blacklisted
0. 01:80:C2:00:00:01
1. 01:80:C2:00:00:03

Transporting Fixtures

So it might not be the best idea to publish a standard list of usernames and passwords that are used for testing in live systems. We therefore expect the actual values for the test fixtures (or at least the passwords) to be confidential. To facilitate the exchange of known fixtures, we have the following XML DTD which defines the values of fixtures, so multiple parties can communicate test data easily.

note : the values of the test fixtures below are non-normative. Fixture data is loaded from an XML file and referenced in the tests by it's id attribute.

Fixture Transport DTD

<!DOCTYPE fixtures [

<!ELEMENT fixtures (agentdomains,regions,accounts,agents,urls,fauxmachines,id0blacklist,macblacklist)>
<!ELEMENT agentdomains (agent+)>
<!ELEMENT agent (#CDATA)>
<!ATTLIST agent id CDATA #REQUIRED>
<!ELEMENT regions (region+)>
<!ELEMENT region (host,port)>
<!ATTLIST region id CDATA #REQUIRED>
<!ELEMENT host (#CDATA)>
<!ELEMENT port (#CDATA)>
<!ELEMENT accounts (account+)>
<!ELEMENT account (name,password,agentrefs+)>
<!ATTLIST account id CDATA #REQURED>
<!ELEMENT name (#CDATA)>
<!ELEMENT password (#CDATA)>
<!ELEMENT agentrefs (agentref+)>
<!ELEMENT agentref (#EMPTY)>
<!ATTLIST agentref ref CDATA #REQUIRED>
<!ELEMENT agents (agent+)>
<!ELEMENT agent (firstname,lastname,password)>
<!ATTLIST agent id CDATA #REQUIRED>
<!ELEMENT firstname (#CDATA)>
<!ELEMENT lastname (#CDATA)>
<!ELEMENT password (#CDATA)>
<!ELEMENT urls (url+)>
<!ELEMENT url (#CDATA)>
<!ATTLIST url id CDATA #REQUIRED>
<!ELEMENT fauxmachines (fauxmachine+)>
<!ELEMENT fauxmachine (mac,id0)>
<!ATTLIST fauxmachine id CDATA #REQUIRED>
<!ELEMENT mac (#CDATA)>
<!ELEMENT id0 (#CDATA)>
<!ELEMENT id0blacklist (id0+)>
<!ELEMENT macblacklist (mac+)>

]>

An Example of Fixture Data

<?xml version="1.0"?>
<fixtures>

  <loginhosts>
    <loginhost id="0_0">login.aditi.lindenlab.com</agent>
  </loginhosts>

  <agentdomains>
    <agentdomain id="1_0">agent0.aditi.lindenlab.com</agentdomain>
  </agentdomain>

  <regions>
   <region id="2_0">
      <host>sim1.vaak.lindenlab.com</host>
      <port>13000</port>
    <region>
   <region id="2_1">
      <host>sim1.vaak.lindenlab.com</host>
      <port>13001</port>
    <region>
  </regions>

  <agents>
    <agent id="3_0">
      <firstname>Arthur</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_1">
      <firstname>Bertha</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_2">
      <firstname>Cristobal</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_3">
      <firstname>Dolly</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_4">
      <firstname>Edouard</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_5">
      <firstname>Fay</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_6">
      <firstname>Gustav</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_7">
      <firstname>Hanna</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_8">
      <firstname>Ana</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_9">
      <firstname>Bill</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_10">
      <firstname>Claudette</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_11">
      <firstname>Danny</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_12">
      <firstname>Erika</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_13">
      <firstname>Fred</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_14">
      <firstname>Grace</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_15">
      <firstname>Henri</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_16">
      <firstname>Alex</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_17">
      <firstname>Bonnie</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_18">
      <firstname>Colin</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_19">
      <firstname>Danielle</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_20">
      <firstname>Earl</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_21">
      <firstname>Fiona</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_22">
      <firstname>Gaston</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_23">
      <firstname>Hermine</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_24">
      <firstname>Arlene</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_25">
      <firstname>Bret</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_26">
      <firstname>Cindy</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_27">
      <firstname>Don</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_28">
      <firstname>Emily</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_29">
      <firstname>Franklin</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_30">
      <firstname>Gert</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>

    <agent id="3_31">
      <firstname>Harvey</firstname>
      <lastname>Crimthande</lastname>
      <password>changeme</password>
    </agent>
  </agents>

  <accounts/>

  <machines>
    <machine id="5_0">
      <mac>01:80:C2:00:00:00</mac>
      <id0>3fPkIs1eG0doeDj8uscIZQ==</id0>
    </machine>
    <machine id="5_1">
      <mac>01:80:C2:00:00:01</mac>
      <id0>wVenkDHhxA+FkxgpvF/FUg==</id0>
    </machine>
    <machine id="5_2">
      <mac>01:80:C2:00:00:02</mac>
      <id0>4EahsGwT/GYg9uBSQeKcNA==</id0>
    </machine>
    <machine id="5_3">
      <mac>01:80:C2:00:00:03</mac>
      <id0>07BzhNET7exJ6qYjitX/AA==</id0>
    </machine>
  </machines>
  <id0blacklist>
    <id0 id="6_0">4EahsGwT/GYg9uBSQeKcNA==</id0>
    <id0 id="6_1">07BzhNET7exJ6qYjitX/AA==</id0>
  </id0blacklist>
  <macblaclist>
    <mac id="7_0">01:80:C2:00:00:01</mac>
    <mac id="7_1">01:80:C2:00:00:03</mac>
  </macblacklist>
</fixtures>

Base Tests

REST Tests

LLSD (Linden Lab Structured Data)

Event Queue

Capabilities

Resource Tests

Agent Credential

Account Credential

Login Tests

Authentication is the process of associating a viewer with an agent domain, then placing the user's avatar in a region managed by a (potentially separate) region domain. The spec describes logging in as the sequence:

  1. The viewer authenticates to an agent domain for the authorized control of a particular agent.
  2. The viewer directs the agent domain to to place the agent in a region.
  3. The agent domain contacts the region domain for the region, and negotiates placement of the agent.
  4. The region grants access to the agent domain, which in turn passes some of that granted access on to the viewer.

Testing the login process means logging each of these steps, in order. We should also test that executing them out of order leads to an error.

We assume the code providing underlying services (such as the event queue, LLSD serialization / deserialization, MD5 Hash production, etc.) is reliable and has been tested.

Authentication From Client to Agent Domain

The authentication suite verifies that the agent domain "does the right thing" in the face of a number of common circumstances. Before the tests are run, the agent domain should configure agents and accounts as defined in the fixtures section above.

0. positive agent authentication
The positive agent authentication test suite checks whether or not we can successfully log in.
0. attempt to authenticate as agent 3_24
expect seed cap in return
1. attempt to authenticate as agent 3_28
if grid is in "admin only mode," expect failure with reason code set to "insufficient admin rights"
if grid is not in "admin only mode," expect seed cap
1. positive account authentication
The positive agent authentication test suite checks whether or not we can successfully log in using account credentials.
2. verify that you may not log in if you don't accept TOS and read critical messages
Before a user may successfully log in, they must accept both the Terms of Service (TOS) and read critical messages. The agent domain maintains "accepted TOS" and "read critical messages" state so it may remember who may log in.
0. attempt to authenticate as agent 3_3 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
1. attempt to authenticate as agent 3_7 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
2. attempt to authenticate as agent 3_11 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
3. attempt to authenticate as agent 3_15 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
4. attempt to authenticate as agent 3_19 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
5. attempt to authenticate as agent 3_23 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
6. attempt to authenticate as agent 3_27 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
7. attempt to authenticate as agent 3_31 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
3. agent domain remembers TOS acceptance and reading of critical messages
The positive agent authentication test suite checks whether or not we can successfully log in using account credentials.
0. attempt to authenticate as agent 3_0 with TOS acceptance and read critical messages set to false.
expect failure with reason code set to "accept TOS"
1. attempt to authenticate as agent 3_0 with TOS acceptance set to true and read critical messages set to false.
expect failure with reason code set to "read critical messages"
1. attempt to authenticate as agent 3_0 with TOS acceptance set to true and read critical messages set to true.
expect seed cap

Teleport Tests

"Teleporting" is the process of moving from one region to another by means other than "walking across" a region boundary. Teleport does not assume that regions are adjacent.