diff options
author | Justin Clarke Casey | 2009-01-23 19:24:36 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-01-23 19:24:36 +0000 |
commit | 664f983943dd94d35184f5c0f69f8c58a011ba3a (patch) | |
tree | e86d12204576547e502047a2d1054bfc95cd8cb2 | |
parent | Fix for llGetRot when the script is in a child prim. Also fixed llGetPrimitiv... (diff) | |
download | opensim-SC_OLD-664f983943dd94d35184f5c0f69f8c58a011ba3a.zip opensim-SC_OLD-664f983943dd94d35184f5c0f69f8c58a011ba3a.tar.gz opensim-SC_OLD-664f983943dd94d35184f5c0f69f8c58a011ba3a.tar.bz2 opensim-SC_OLD-664f983943dd94d35184f5c0f69f8c58a011ba3a.tar.xz |
* Extend archive test to check for the presence of a control file in a saved archive
Diffstat (limited to '')
6 files changed, 55 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/GenericAsyncResult.cs b/OpenSim/Framework/Communications/GenericAsyncResult.cs index e85289a..62a921a 100644 --- a/OpenSim/Framework/Communications/GenericAsyncResult.cs +++ b/OpenSim/Framework/Communications/GenericAsyncResult.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Communications | |||
41 | private byte m_completed; | 41 | private byte m_completed; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Did process complete synchroneously? | 44 | /// Did process complete synchronously? |
45 | /// </summary> | 45 | /// </summary> |
46 | /// <remarks>I have a hard time imagining a scenario where this is the case, again, same issue about | 46 | /// <remarks>I have a hard time imagining a scenario where this is the case, again, same issue about |
47 | /// booleans and VolatileRead as m_completed | 47 | /// booleans and VolatileRead as m_completed |
@@ -87,6 +87,7 @@ namespace OpenSim.Framework.Communications | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | } | 89 | } |
90 | |||
90 | return m_waitHandle; | 91 | return m_waitHandle; |
91 | } | 92 | } |
92 | } | 93 | } |
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 1abfc78..fe904b5 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
@@ -108,6 +108,7 @@ namespace OpenSim.Framework.Communications | |||
108 | { | 108 | { |
109 | // Temporary fix | 109 | // Temporary fix |
110 | m_loginMutex.WaitOne(); | 110 | m_loginMutex.WaitOne(); |
111 | |||
111 | try | 112 | try |
112 | { | 113 | { |
113 | //CFK: CustomizeResponse contains sufficient strings to alleviate the need for this. | 114 | //CFK: CustomizeResponse contains sufficient strings to alleviate the need for this. |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 09776a7..bd58e7c 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -94,11 +94,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
94 | 94 | ||
95 | byte[] data; | 95 | byte[] data; |
96 | TarArchiveReader.TarEntryType entryType; | 96 | TarArchiveReader.TarEntryType entryType; |
97 | |||
97 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) | 98 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) |
98 | { | 99 | { |
99 | //m_log.DebugFormat( | 100 | //m_log.DebugFormat( |
100 | // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length); | 101 | // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length); |
101 | if (entryType==TarArchiveReader.TarEntryType.TYPE_DIRECTORY) { | 102 | if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) |
103 | { | ||
102 | m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", | 104 | m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", |
103 | filePath); | 105 | filePath); |
104 | } | 106 | } |
@@ -407,7 +409,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
407 | 409 | ||
408 | private static Stream URIFetch(Uri uri) | 410 | private static Stream URIFetch(Uri uri) |
409 | { | 411 | { |
410 | |||
411 | HttpWebRequest request = (HttpWebRequest) WebRequest.Create(uri); | 412 | HttpWebRequest request = (HttpWebRequest) WebRequest.Create(uri); |
412 | 413 | ||
413 | // request.Credentials = credentials; | 414 | // request.Credentials = credentials; |
@@ -425,8 +426,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
425 | 426 | ||
426 | // return new BufferedStream(file, (int) response.ContentLength); | 427 | // return new BufferedStream(file, (int) response.ContentLength); |
427 | return new BufferedStream(file, 1000000); | 428 | return new BufferedStream(file, 1000000); |
428 | |||
429 | } | 429 | } |
430 | |||
431 | } | 430 | } |
432 | } | 431 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/Environment/Modules/World/Archiver/Tests/ArchiverTests.cs index 149293d..db296b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -25,8 +25,14 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.IO; | ||
28 | using NUnit.Framework; | 29 | using NUnit.Framework; |
30 | using NUnit.Framework.SyntaxHelpers; | ||
31 | using OpenSim.Region.Environment.Interfaces; | ||
29 | using OpenSim.Region.Environment.Modules.World.Archiver; | 32 | using OpenSim.Region.Environment.Modules.World.Archiver; |
33 | using OpenSim.Region.Environment.Modules.World.Terrain; | ||
34 | using OpenSim.Region.Environment.Scenes; | ||
35 | using OpenSim.Tests.Common.Setup; | ||
30 | 36 | ||
31 | namespace OpenSim.Region.Environment.Modules.World.Archiver.Tests | 37 | namespace OpenSim.Region.Environment.Modules.World.Archiver.Tests |
32 | { | 38 | { |
@@ -38,11 +44,37 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver.Tests | |||
38 | /// </summary> | 44 | /// </summary> |
39 | [Test] | 45 | [Test] |
40 | public void TestSaveOarV0p2() | 46 | public void TestSaveOarV0p2() |
41 | { | 47 | { |
42 | // Create an archive containing only a terrain | 48 | //log4net.Config.XmlConfigurator.Configure(); |
43 | //TarArchiveWriter taw = new TarArchiveWriter(); | ||
44 | 49 | ||
45 | //System.Console.WriteLine("wibble"); | 50 | ArchiverModule archiverModule = new ArchiverModule(); |
51 | TerrainModule terrainModule = new TerrainModule(); | ||
52 | |||
53 | Scene scene = SceneSetupHelpers.SetupScene(); | ||
54 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule, terrainModule); | ||
55 | |||
56 | MemoryStream archiveWriteStream = new MemoryStream(); | ||
57 | archiverModule.ArchiveRegion(archiveWriteStream); | ||
58 | |||
59 | // If there are no assets to fetch, then the entire archive region code path will execute in this thread, | ||
60 | // so no need to worry about signalling. | ||
61 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | ||
62 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); | ||
63 | |||
64 | bool gotControlFile = false; | ||
65 | |||
66 | string filePath; | ||
67 | TarArchiveReader.TarEntryType tarEntryType; | ||
68 | |||
69 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | ||
70 | { | ||
71 | if (ArchiveConstants.CONTROL_FILE_PATH == filePath) | ||
72 | gotControlFile = true; | ||
73 | } | ||
74 | |||
75 | Assert.That(gotControlFile, Is.True, "No control file in archive"); | ||
76 | |||
77 | // TODO: Test presence of more files and contents of files. | ||
46 | } | 78 | } |
47 | } | 79 | } |
48 | } \ No newline at end of file | 80 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs index 0c7de74..221d97f 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/StandaloneTeleportTests.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
52 | [Test] | 52 | [Test] |
53 | public void TestSimpleNotNeighboursTeleport() | 53 | public void TestSimpleNotNeighboursTeleport() |
54 | { | 54 | { |
55 | log4net.Config.XmlConfigurator.Configure(); | 55 | //log4net.Config.XmlConfigurator.Configure(); |
56 | 56 | ||
57 | UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); | 57 | UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); |
58 | UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); | 58 | UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); |
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 74f177a..44c32ff 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -96,10 +96,20 @@ namespace OpenSim.Tests.Common.Setup | |||
96 | = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test"); | 96 | = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test"); |
97 | 97 | ||
98 | return testScene; | 98 | return testScene; |
99 | } | 99 | } |
100 | |||
101 | /// <summary> | ||
102 | /// Setup modules for a scene using their default settings. | ||
103 | /// </summary> | ||
104 | /// <param name="scene"></param> | ||
105 | /// <param name="modules"></param> | ||
106 | public static void SetupSceneModules(Scene scene, params IRegionModule[] modules) | ||
107 | { | ||
108 | SetupSceneModules(scene, null, modules); | ||
109 | } | ||
100 | 110 | ||
101 | /// <summary> | 111 | /// <summary> |
102 | /// Setup the given modules for a given scene. | 112 | /// Setup modules for a scene. |
103 | /// </summary> | 113 | /// </summary> |
104 | /// <param name="scene"></param> | 114 | /// <param name="scene"></param> |
105 | /// <param name="config"></param> | 115 | /// <param name="config"></param> |