From 29a740ec8c78bfc3c1ab5b41b302ae2205c6e9aa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Dec 2009 18:03:53 +0100 Subject: Initial windlight codebase commit --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 27025d9..5f172c4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -491,7 +491,7 @@ namespace OpenSim.Tests.Common.Mock } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, List message) { } -- cgit v1.1 From cfca9e1e811f6cdea6b7c3338f7f783a07f8e0ac Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 29 Jan 2010 07:20:13 +0000 Subject: Revert "Updates all IRegionModules to the new style region modules." This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf. --- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 20f2bca..b13e8dd 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -161,11 +161,10 @@ namespace OpenSim.Tests.Common.Setup capsModule.Initialise(new IniConfigSource()); testScene.AddRegionModule(capsModule.Name, capsModule); capsModule.AddRegion(testScene); - - INonSharedRegionModule godsModule = new GodsModule(); - godsModule.Initialise(new IniConfigSource()); - testScene.AddRegionModule(godsModule.Name, godsModule); - godsModule.AddRegion(testScene); + + IRegionModule godsModule = new GodsModule(); + godsModule.Initialise(testScene, new IniConfigSource()); + testScene.AddModule(godsModule.Name, godsModule); realServices = realServices.ToLower(); // IConfigSource config = new IniConfigSource(); -- cgit v1.1 From fce9e499e4682edf6db7b4f9c5546524b4a25197 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Mar 2010 01:19:45 -0600 Subject: - parcel blocking, region crossing blocking, teleport blocking --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0d9dcc6..715e1a4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -96,6 +96,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnRegionHandShakeReply; public event GenericCall2 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; + public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; -- cgit v1.1 From 0f3314c04ccd07e0ff9b5be69903b0a72dd73115 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 8 Apr 2010 15:00:01 -0700 Subject: Backported GetTextureModule and IAssetService.GetCached() --- OpenSim/Tests/Common/Mock/MockAssetService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs index cb38043..4118308 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetService.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetService.cs @@ -65,6 +65,11 @@ namespace OpenSim.Tests.Common.Mock return asset; } + public AssetBase GetCached(string id) + { + return Get(id); + } + public AssetMetadata GetMetadata(string id) { throw new System.NotImplementedException(); -- cgit v1.1 From 8f838c722da978da646fcef59a5af767840832bb Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Mon, 17 May 2010 14:14:19 -0700 Subject: When killing a zombie session, don't send the stop packet since it often has the effect of killing a newly connected client. --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b07a072..05a8ff0 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -888,6 +888,10 @@ namespace OpenSim.Tests.Common.Mock public void Close() { + Close(true); + } + public void Close(bool sendStop) + { m_scene.RemoveClient(AgentId); } -- cgit v1.1 From 91b1d17e5bd3ff6ed006744bc529b53a67af1a64 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Tue, 18 May 2010 01:09:47 -0700 Subject: Fix for hanging on "Connecting to region".. caused by packets being processed before the presence has bound to receive events. Fixed this by adding packets to a queue and then processing them when the presence is ready. --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 05a8ff0..815816a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -882,6 +882,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void ProcessPendingPackets() + { + } + public void ProcessInPacket(Packet NewPack) { } -- cgit v1.1 From a5a1df68c29b2d78279bcff60ce66fe97772d0c6 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Mon, 28 Jun 2010 04:02:33 -0700 Subject: Provide the interface for StoreAsset to report success or failure --- OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs index 4a15cf2..5bab62c 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs @@ -54,9 +54,10 @@ namespace OpenSim.Tests.Common.Mock return assets.Find(x=>x.FullID == uuid); } - public void StoreAsset(AssetBase asset) + public bool StoreAsset(AssetBase asset) { assets.Add(asset); + return true; } public List FetchAssetMetadataSet(int start, int count) { return new List(count); } -- cgit v1.1 From bebbe407ee166a0aa22f0ec8d14ada780924f9af Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 14 Jul 2010 19:58:23 +0200 Subject: Major attachments cleanup. Remove unused AttachObject ClientView method Clean up use of AttachObject throughout, reduce number of overloads and number of parameters --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f8304c0..2993b46 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -630,10 +630,6 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) - { - } - public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) { } -- cgit v1.1 From 330343505ca2d6d109e89b4767f4351ab9bec91d Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 6 Aug 2010 11:39:10 -0700 Subject: Implement CreateNewOutfitAttachments. This addresses mantis #199. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2993b46..1e4bc2a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common.Mock public event MoneyTransferRequest OnMoneyTransferRequest; public event ParcelBuy OnParcelBuy; public event Action OnConnectionClosed; - + public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; public event ImprovedInstantMessage OnInstantMessage; public event ChatMessage OnChatFromClient; public event TextureRequest OnRequestTexture; -- cgit v1.1 From 42f76773a15d83fd31f249cc4a21985184b0cdbf Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 6 Oct 2010 19:59:30 +0200 Subject: Plumb the path for multiple object deletes --- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index fc9db03..9d7733e 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -556,7 +556,7 @@ namespace OpenSim.Tests.Common.Setup AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; sogd.Enabled = false; - scene.DeRezObject(client, part.LocalId, UUID.Zero, action, destinationId); + scene.DeRezObjects(client, new List() { part.LocalId }, UUID.Zero, action, destinationId); sogd.InventoryDeQueueAndDelete(); } } -- cgit v1.1 From 52dd547863c0cdd22f53f0efcaef11ae096855a0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 11:31:52 +0200 Subject: Make SendKillObject send multiple localIDs in one packet. This avoids the halting visual behavior of large group deletes and eliminates the packet flood --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 1c860a7..6324146 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -487,7 +487,7 @@ namespace OpenSim.Tests.Common.Mock } - public virtual void SendKillObject(ulong regionHandle, uint localID) + public virtual void SendKillObject(ulong regionHandle, List localID) { } -- cgit v1.1 From f985775962ae8da0010cc5ef5f903a53b550f5d2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 5 Nov 2010 14:27:14 +0100 Subject: Revert "Fix for hanging on "Connecting to region".. caused by packets being processed before the presence has bound to receive events. Fixed this by adding packets to a queue and then processing them when the presence is ready." This reverts commit 91b1d17e5bd3ff6ed006744bc529b53a67af1a64. Conflicts: OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4e600b5..fbc339a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -879,10 +879,6 @@ namespace OpenSim.Tests.Common.Mock { } - public void ProcessPendingPackets() - { - } - public void ProcessInPacket(Packet NewPack) { } -- cgit v1.1 From 2cb2bff9b2ab68c325b0142da0b37730be9a12a3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 30 Dec 2010 00:31:59 +0100 Subject: Implement SendPlacesReply --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 69a152f..147571b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1229,5 +1229,9 @@ namespace OpenSim.Tests.Common.Mock public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } } -- cgit v1.1 From ec0aa7a90b578572fc45f27b5113a174ff37643e Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 17 Apr 2011 23:17:05 +0200 Subject: Fix up client implementations --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d1b4feb..592009d 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -268,7 +268,7 @@ namespace OpenSim.Tests.Common.Mock public event ClassifiedInfoRequest OnClassifiedInfoRequest; public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; public event ClassifiedDelete OnClassifiedDelete; - public event ClassifiedDelete OnClassifiedGodDelete; + public event ClassifiedGodDelete OnClassifiedGodDelete; public event EventNotificationAddRequest OnEventNotificationAddRequest; public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; -- cgit v1.1 From 96174595da269f50d37c88c213ad00b79a7c7c83 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 23 Jul 2011 11:39:32 +0100 Subject: Fix LLTextBox to work with the updated libOMV --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index bacd773..0f89f84 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1218,7 +1218,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) + public void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId) { } -- cgit v1.1 From ec8c93aa5e1d0af2c0adf38156b05e85421f4a81 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 4 Dec 2011 12:35:01 +0100 Subject: Implement ChangeInventoryItemFlagsPacket handling --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index cedd6c7..1e74451 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -312,6 +312,7 @@ namespace OpenSim.Tests.Common.Mock public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; public event SimWideDeletesDelegate OnSimWideDeletes; public event SendPostcard OnSendPostcard; + public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; public event MuteListEntryUpdate OnUpdateMuteListEntry; public event MuteListEntryRemove OnRemoveMuteListEntry; public event GodlikeMessage onGodlikeMessage; -- cgit v1.1 From 07c487a28f6ce6d85cf32fba0c2ded724f7b5af7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 2 Feb 2012 21:36:45 +0100 Subject: Make ban, eject, freeze and the scripted versions of those work. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b06bff6..c32dbf5 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -985,7 +985,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) + public void SendLandAccessListData(List accessList, uint accessFlag, int localLandID) { } -- cgit v1.1 From 908abb1c3dded307e769abac71f660b835875975 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 10 Mar 2012 20:32:19 +0000 Subject: BIG MESS. changed Iclient interface so only one event is used to inform scene about position scale or rotation change by client (others can be added). Its served at SceneGraph that does permition checks, undostore and sends down to SOG. changed values are stored in a class (ObjectChangeData) and what is changed as a enum (ObjectChangeWhat) with bit fields and 'macros' of this for better readability (at top of scenegraph.cs lasy to find better place for now) this can be extended for other things clients changes and need undo/redo. SOG process acording to what is changed. Changed UNDO/redo to use this also (warning is only storing what is changed, previus stored all, this must be checked for side efects. to save all PRS change commented line in scenegraph). Still have excessive calls to ScheduleGroupForTerseUpdate. **** UNTESTED **** --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index fa750ab..be6b81b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -135,6 +135,7 @@ namespace OpenSim.Tests.Common.Mock public event GenericCall7 OnObjectMaterial; public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimTexture OnUpdatePrimTexture; + public event ClientChangeObject onClientChangeObject; public event UpdateVector OnUpdatePrimGroupPosition; public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; -- cgit v1.1 From 84ca09f7c5cec051014181853083e52691bb7e07 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 15 Mar 2012 02:24:13 +0000 Subject: added ObjectPhysicsProperties http event message to send viewer that data. For now on caps/EventQueue, and still only used on a material change... --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index be6b81b..2fe22a5 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1258,5 +1258,9 @@ namespace OpenSim.Tests.Common.Mock public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) { } + + public void SendPartPhysicsProprieties(ISceneEntity entity) + { + } } } -- cgit v1.1 From 7461fe4554f8104212071e3e01b07786f8eb546f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 12 May 2012 15:27:37 +0100 Subject: ªTEST MESS* reduce animation packets send. Added onchangeanim event with parameters to define if to add or remove, and if to send anims pack on that evocation, etc --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6a7cb0a..b2c824c 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -88,6 +88,7 @@ namespace OpenSim.Tests.Common.Mock public event ObjectDrop OnObjectDrop; public event StartAnim OnStartAnim; public event StopAnim OnStopAnim; + public event ChangeAnim OnChangeAnim; public event LinkObjects OnLinkObjects; public event DelinkObjects OnDelinkObjects; public event RequestMapBlocks OnRequestMapBlocks; -- cgit v1.1 From 26c5b329886e3bbf81e2c853ef2fc6d648ad5273 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Jun 2012 22:39:03 +0200 Subject: Add the ability to query the MYSQL databse for a list of the stored prim UUIDs --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 579d41c..38fbbe3 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -112,6 +112,11 @@ namespace OpenSim.Data.Null { m_store.StoreRegionWindlightSettings(wl); } + + public UUID[] GetObjectIDs(UUID regionID) + { + return new UUID[0]; + } } /// @@ -285,5 +290,10 @@ namespace OpenSim.Data.Null public void Shutdown() { } + + public UUID[] GetObjectIDs(UUID regionID) + { + return new UUID[0]; + } } } -- cgit v1.1 From ce8b9e6c570f73a5c70dfc2b52bbb595637b717d Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 19 Jul 2012 12:27:36 +0200 Subject: Fix slow loading of task inventory --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index e254dd8..6add130 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -732,7 +732,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) + public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) { } -- cgit v1.1 From 7d1bec00d5cda6d7024a3d64b5913b5c08c15a3f Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Aug 2012 01:08:30 +0200 Subject: Add a skeleton for a name value storage associated with regions --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 3f99a39..5c1ec0b 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -132,6 +132,19 @@ namespace OpenSim.Data.Null { return new UUID[0]; } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } /// @@ -328,5 +341,18 @@ namespace OpenSim.Data.Null { return new UUID[0]; } + + public void SaveExtra(UUID regionID, string name, string value) + { + } + + public void RemoveExtra(UUID regionID, string name) + { + } + + public Dictionary GetExtra(UUID regionID) + { + return null; + } } } -- cgit v1.1 From ca67ee60ac0e0c26d6d32fc68d48ef63570f034d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 24 Sep 2012 21:22:08 +0100 Subject: add missing transactionID in SendInventoryItemCreateUpdate. and make use of it on inventoryAccessModule, etc. Most likelly it's needs where there is a transactionID not zero --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6add130..49a8d26 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -716,6 +716,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) + { + } + public virtual void SendRemoveInventoryItem(UUID itemID) { } -- cgit v1.1 From 4fa088bafb4c78ad3177b0e944a4312bd6abdea7 Mon Sep 17 00:00:00 2001 From: teravus Date: Sun, 4 Nov 2012 22:57:24 -0500 Subject: Pipe Throttle Update Event to EventManager, client --> ScenePresence --> EventManager, so that modules can know when throttles are updated. The event contains no client specific data to preserve the possibility of 'multiple clients' and you must still call ControllingClient.GetThrottlesPacked(f) to see what the throttles actually are once the event fires. Hook EventManager.OnUpdateThrottle to GetTextureModule. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 49a8d26..78bb18e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -320,7 +320,7 @@ namespace OpenSim.Tests.Common.Mock public event MuteListEntryRemove OnRemoveMuteListEntry; public event GodlikeMessage onGodlikeMessage; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; - + public event GenericCall2 OnUpdateThrottles; #pragma warning restore 67 /// -- cgit v1.1 From e9153e1d1aae50024d8cd05fe14a9bce34343a0e Mon Sep 17 00:00:00 2001 From: teravus Date: Thu, 15 Nov 2012 10:05:16 -0500 Subject: Revert "Merge master into teravuswork", it should have been avination, not master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- .../Tests/Common/Helpers/UserInventoryHelpers.cs | 4 +- OpenSim/Tests/Common/Mock/TestClient.cs | 16 +- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 131 -------------- OpenSim/Tests/Common/TestHelpers.cs | 1 - OpenSim/Tests/Performance/NPCPerformanceTests.cs | 190 --------------------- .../Tests/Performance/ObjectPerformanceTests.cs | 175 ------------------- .../Tests/Performance/ScriptPerformanceTests.cs | 168 ------------------ .../Tests/Stress/VectorRenderModuleStressTests.cs | 132 -------------- OpenSim/Tests/Torture/NPCTortureTests.cs | 190 +++++++++++++++++++++ OpenSim/Tests/Torture/ObjectTortureTests.cs | 175 +++++++++++++++++++ OpenSim/Tests/Torture/ScriptTortureTests.cs | 168 ++++++++++++++++++ 12 files changed, 545 insertions(+), 807 deletions(-) delete mode 100644 OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs delete mode 100644 OpenSim/Tests/Performance/NPCPerformanceTests.cs delete mode 100644 OpenSim/Tests/Performance/ObjectPerformanceTests.cs delete mode 100644 OpenSim/Tests/Performance/ScriptPerformanceTests.cs delete mode 100644 OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs create mode 100644 OpenSim/Tests/Torture/NPCTortureTests.cs create mode 100644 OpenSim/Tests/Torture/ObjectTortureTests.cs create mode 100644 OpenSim/Tests/Torture/ScriptTortureTests.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index fc49169..7598cc3 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -245,7 +245,7 @@ namespace OpenSim.Tests.Common config.AddConfig("Modules"); config.AddConfig("InventoryService"); config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); - config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService"); + config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index 87d9410..b3a7c9e 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -199,9 +199,7 @@ namespace OpenSim.Tests.Common string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); InventoryFolderBase newFolder - = new InventoryFolderBase( - UUID.Random(), components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0); - + = new InventoryFolderBase(UUID.Random(), components[0], parentFolder.Owner, parentFolder.ID); inventoryService.AddFolder(newFolder); if (components.Length > 1) diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 5ad3c9f..78bb18e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -531,9 +531,13 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendChatMessage( - string message, byte type, Vector3 fromPos, string fromName, - UUID fromAgentID, UUID ownerID, byte source, byte audible) + public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, byte source, byte audible) + { + } + + public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, byte source, byte audible) { } @@ -935,12 +939,12 @@ namespace OpenSim.Tests.Common.Mock Close(); } - public void Close() + public void Close(bool c) { - Close(true, false); + Close(); } - public void Close(bool sendStop, bool force) + public void Close() { // Fire the callback for this connection closing // This is necesary to get the presence detector to notice that a client has logged out. diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs deleted file mode 100644 index bca5979..0000000 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using log4net; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Data; - -namespace OpenSim.Tests.Common.Mock -{ - public class TestXInventoryDataPlugin : IXInventoryData - { - private Dictionary m_allFolders = new Dictionary(); - private Dictionary m_allItems = new Dictionary(); - - public TestXInventoryDataPlugin(string conn, string realm) {} - - public XInventoryItem[] GetItems(string[] fields, string[] vals) - { - List origItems = Get(fields, vals, m_allItems.Values.ToList()); - - return origItems.Select(i => i.Clone()).ToArray(); - } - - public XInventoryFolder[] GetFolders(string[] fields, string[] vals) - { - List origFolders - = Get(fields, vals, m_allFolders.Values.ToList()); - - return origFolders.Select(f => f.Clone()).ToArray(); - } - - private List Get(string[] fields, string[] vals, List inputEntities) - { - List entities = inputEntities; - - for (int i = 0; i < fields.Length; i++) - { - entities - = entities.Where( - e => - { - FieldInfo fi = typeof(T).GetField(fields[i]); - if (fi == null) - throw new NotImplementedException(string.Format("No field {0} for val {1}", fields[i], vals[i])); - - return fi.GetValue(e).ToString() == vals[i]; - } - ).ToList(); - } - - return entities; - } - - public bool StoreFolder(XInventoryFolder folder) - { - m_allFolders[folder.folderID] = folder.Clone(); - -// Console.WriteLine("Added folder {0} {1}", folder.folderName, folder.folderID); - - return true; - } - - public bool StoreItem(XInventoryItem item) - { - m_allItems[item.inventoryID] = item.Clone(); - -// Console.WriteLine("Added item {0} {1}, creator {2}, owner {3}", item.inventoryName, item.inventoryID, item.creatorID, item.avatarID); - - return true; - } - - public bool DeleteFolders(string field, string val) - { - return DeleteFolders(new string[] { field }, new string[] { val }); - } - - public bool DeleteFolders(string[] fields, string[] vals) - { - XInventoryFolder[] foldersToDelete = GetFolders(fields, vals); - Array.ForEach(foldersToDelete, f => m_allFolders.Remove(f.folderID)); - - return true; - } - - public bool DeleteItems(string field, string val) - { - return DeleteItems(new string[] { field }, new string[] { val }); - } - - public bool DeleteItems(string[] fields, string[] vals) - { - XInventoryItem[] itemsToDelete = GetItems(fields, vals); - Array.ForEach(itemsToDelete, i => m_allItems.Remove(i.inventoryID)); - - return true; - } - - public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } - public XInventoryItem[] GetActiveGestures(UUID principalID) { throw new NotImplementedException(); } - public int GetAssetPermissions(UUID principalID, UUID assetID) { throw new NotImplementedException(); } - } -} \ No newline at end of file diff --git a/OpenSim/Tests/Common/TestHelpers.cs b/OpenSim/Tests/Common/TestHelpers.cs index 57da802..30121fe 100644 --- a/OpenSim/Tests/Common/TestHelpers.cs +++ b/OpenSim/Tests/Common/TestHelpers.cs @@ -95,7 +95,6 @@ namespace OpenSim.Tests.Common public static void EnableLogging() { log4net.Config.XmlConfigurator.Configure(EnableLoggingConfigStream); - EnableLoggingConfigStream.Position = 0; } /// diff --git a/OpenSim/Tests/Performance/NPCPerformanceTests.cs b/OpenSim/Tests/Performance/NPCPerformanceTests.cs deleted file mode 100644 index 627765b..0000000 --- a/OpenSim/Tests/Performance/NPCPerformanceTests.cs +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Reflection; -using log4net; -using Nini.Config; -using NUnit.Framework; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Region.CoreModules.Avatar.Attachments; -using OpenSim.Region.CoreModules.Avatar.AvatarFactory; -using OpenSim.Region.CoreModules.Framework.InventoryAccess; -using OpenSim.Region.CoreModules.Framework.UserManagement; -using OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.OptionalModules.World.NPC; -using OpenSim.Services.AvatarService; -using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; - -namespace OpenSim.Tests.Performance -{ - /// - /// NPC performance tests - /// - /// - /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached, - /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller - /// earlier tests. - /// - [TestFixture] - public class NPCPerformanceTests - { - private TestScene scene; - private AvatarFactoryModule afm; - private UserManagementModule umm; - private AttachmentsModule am; - - [TestFixtureSetUp] - public void FixtureInit() - { - // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread. - Util.FireAndForgetMethod = FireAndForgetMethod.None; - } - - [TestFixtureTearDown] - public void TearDown() - { - scene.Close(); - scene = null; - GC.Collect(); - GC.WaitForPendingFinalizers(); - - // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple - // threads. Possibly, later tests should be rewritten not to worry about such things. - Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod; - } - - [SetUp] - public void Init() - { - IConfigSource config = new IniConfigSource(); - config.AddConfig("NPC"); - config.Configs["NPC"].Set("Enabled", "true"); - config.AddConfig("Modules"); - config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); - - afm = new AvatarFactoryModule(); - umm = new UserManagementModule(); - am = new AttachmentsModule(); - - scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule()); - } - - [Test] - public void Test_0001_AddRemove100NPCs() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddRemoveNPCs(100); - } - - [Test] - public void Test_0002_AddRemove1000NPCs() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddRemoveNPCs(1000); - } - - [Test] - public void Test_0003_AddRemove2000NPCs() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddRemoveNPCs(2000); - } - - private void TestAddRemoveNPCs(int numberOfNpcs) - { - ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); -// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); - - // 8 is the index of the first baked texture in AvatarAppearance - UUID originalFace8TextureId = TestHelpers.ParseTail(0x10); - Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero); - Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8); - originalTef.TextureID = originalFace8TextureId; - - // We also need to add the texture to the asset service, otherwise the AvatarFactoryModule will tell - // ScenePresence.SendInitialData() to reset our entire appearance. - scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); - - afm.SetAppearance(sp, originalTe, null); - - INPCModule npcModule = scene.RequestModuleInterface(); - - List npcs = new List(); - - long startGcMemory = GC.GetTotalMemory(true); - Stopwatch sw = new Stopwatch(); - sw.Start(); - - for (int i = 0; i < numberOfNpcs; i++) - { - npcs.Add( - npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, scene, sp.Appearance)); - } - - for (int i = 0; i < numberOfNpcs; i++) - { - Assert.That(npcs[i], Is.Not.Null); - - ScenePresence npc = scene.GetScenePresence(npcs[i]); - Assert.That(npc, Is.Not.Null); - } - - for (int i = 0; i < numberOfNpcs; i++) - { - Assert.That(npcModule.DeleteNPC(npcs[i], scene), Is.True); - ScenePresence npc = scene.GetScenePresence(npcs[i]); - Assert.That(npc, Is.Null); - } - - sw.Stop(); - - long endGcMemory = GC.GetTotalMemory(true); - - Console.WriteLine("Took {0} ms", sw.ElapsedMilliseconds); - Console.WriteLine( - "End {0} MB, Start {1} MB, Diff {2} MB", - endGcMemory / 1024 / 1024, - startGcMemory / 1024 / 1024, - (endGcMemory - startGcMemory) / 1024 / 1024); - } - } -} \ No newline at end of file diff --git a/OpenSim/Tests/Performance/ObjectPerformanceTests.cs b/OpenSim/Tests/Performance/ObjectPerformanceTests.cs deleted file mode 100644 index 2264d86..0000000 --- a/OpenSim/Tests/Performance/ObjectPerformanceTests.cs +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Diagnostics; -using System.Reflection; -using log4net; -using NUnit.Framework; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; - -namespace OpenSim.Tests.Performance -{ - /// - /// Object performance tests - /// - /// - /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached, - /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller - /// earlier tests. - /// - [TestFixture] - public class ObjectPerformanceTests - { - [TearDown] - public void TearDown() - { - GC.Collect(); - GC.WaitForPendingFinalizers(); - } - -// [Test] -// public void Test0000Clean() -// { -// TestHelpers.InMethod(); -//// log4net.Config.XmlConfigurator.Configure(); -// -// TestAddObjects(200000); -// } - - [Test] - public void Test_0001_10K_1PrimObjects() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddObjects(1, 10000); - } - - [Test] - public void Test_0002_100K_1PrimObjects() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddObjects(1, 100000); - } - - [Test] - public void Test_0003_200K_1PrimObjects() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddObjects(1, 200000); - } - - [Test] - public void Test_0011_100_100PrimObjects() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddObjects(100, 100); - } - - [Test] - public void Test_0012_1K_100PrimObjects() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddObjects(100, 1000); - } - - [Test] - public void Test_0013_2K_100PrimObjects() - { - TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - TestAddObjects(100, 2000); - } - - private void TestAddObjects(int primsInEachObject, int objectsToAdd) - { - UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000"); - - // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage - // collected when we teardown this test. If it's done in a member variable, even if that is subsequently - // nulled out, the garbage collect can be delayed. - TestScene scene = new SceneHelpers().SetupScene(); - -// Process process = Process.GetCurrentProcess(); -// long startProcessMemory = process.PrivateMemorySize64; - long startGcMemory = GC.GetTotalMemory(true); - DateTime start = DateTime.Now; - - for (int i = 1; i <= objectsToAdd; i++) - { - SceneObjectGroup so = SceneHelpers.CreateSceneObject(primsInEachObject, ownerId, "part_", i); - Assert.That(scene.AddNewSceneObject(so, false), Is.True, string.Format("Object {0} was not created", i)); - } - - TimeSpan elapsed = DateTime.Now - start; -// long processMemoryAlloc = process.PrivateMemorySize64 - startProcessMemory; - long endGcMemory = GC.GetTotalMemory(false); - - for (int i = 1; i <= objectsToAdd; i++) - { - Assert.That( - scene.GetSceneObjectGroup(TestHelpers.ParseTail(i)), - Is.Not.Null, - string.Format("Object {0} could not be retrieved", i)); - } - - // When a scene object is added to a scene, it is placed in the update list for sending to viewers - // (though in this case we have none). When it is deleted, it is not removed from the update which is - // fine since it will later be ignored. - // - // However, that means that we need to manually run an update here to clear out that list so that deleted - // objects will be clean up by the garbage collector before the next stress test is run. - scene.Update(1); - - Console.WriteLine( - "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", - Math.Round(elapsed.TotalMilliseconds), - (endGcMemory - startGcMemory) / 1024 / 1024, - endGcMemory / 1024 / 1024, - startGcMemory / 1024 / 1024, - objectsToAdd, - primsInEachObject); - - scene.Close(); -// scene = null; - } - } -} \ No newline at end of file diff --git a/OpenSim/Tests/Performance/ScriptPerformanceTests.cs b/OpenSim/Tests/Performance/ScriptPerformanceTests.cs deleted file mode 100644 index d708abd..0000000 --- a/OpenSim/Tests/Performance/ScriptPerformanceTests.cs +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Reflection; -using System.Threading; -using log4net; -using Nini.Config; -using NUnit.Framework; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Region.CoreModules.Scripting.WorldComm; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.ScriptEngine.XEngine; -using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; - -namespace OpenSim.Tests.Performance -{ - /// - /// Script performance tests - /// - /// - /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached, - /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller - /// earlier tests. - /// - [TestFixture] - public class ScriptPerformanceTests - { - private TestScene m_scene; - private XEngine m_xEngine; - private AutoResetEvent m_chatEvent = new AutoResetEvent(false); - - private int m_expectedChatMessages; - private List m_osChatMessagesReceived = new List(); - - [SetUp] - public void Init() - { - //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin"); -// Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory); - m_xEngine = new XEngine(); - - // Necessary to stop serialization complaining - WorldCommModule wcModule = new WorldCommModule(); - - IniConfigSource configSource = new IniConfigSource(); - - IConfig startupConfig = configSource.AddConfig("Startup"); - startupConfig.Set("DefaultScriptEngine", "XEngine"); - - IConfig xEngineConfig = configSource.AddConfig("XEngine"); - xEngineConfig.Set("Enabled", "true"); - - // These tests will not run with AppDomainLoading = true, at least on mono. For unknown reasons, the call - // to AssemblyResolver.OnAssemblyResolve fails. - xEngineConfig.Set("AppDomainLoading", "false"); - - m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource); - SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule); - - m_scene.EventManager.OnChatFromWorld += OnChatFromWorld; - m_scene.StartScripts(); - } - - [TearDown] - public void TearDown() - { - m_scene.Close(); - m_scene = null; - GC.Collect(); - GC.WaitForPendingFinalizers(); - } - - [Test] - public void TestCompileAndStart100Scripts() - { - TestHelpers.InMethod(); - log4net.Config.XmlConfigurator.Configure(); - - TestCompileAndStartScripts(100); - } - - private void TestCompileAndStartScripts(int scriptsToCreate) - { - UUID userId = TestHelpers.ParseTail(0x1); - - m_expectedChatMessages = scriptsToCreate; - int startingObjectIdTail = 0x100; - - GC.Collect(); - - for (int idTail = startingObjectIdTail;idTail < startingObjectIdTail + scriptsToCreate; idTail++) - { - AddObjectAndScript(idTail, userId); - } - - m_chatEvent.WaitOne(40000 + scriptsToCreate * 1000); - - Assert.That(m_osChatMessagesReceived.Count, Is.EqualTo(m_expectedChatMessages)); - - foreach (OSChatMessage msg in m_osChatMessagesReceived) - Assert.That( - msg.Message, - Is.EqualTo("Script running"), - string.Format( - "Message from {0} was {1} rather than {2}", msg.SenderUUID, msg.Message, "Script running")); - } - - private void AddObjectAndScript(int objectIdTail, UUID userId) - { -// UUID itemId = TestHelpers.ParseTail(0x3); - string itemName = string.Format("AddObjectAndScript() Item for object {0}", objectIdTail); - - SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, "AddObjectAndScriptPart_", objectIdTail); - m_scene.AddNewSceneObject(so, true); - - InventoryItemBase itemTemplate = new InventoryItemBase(); -// itemTemplate.ID = itemId; - itemTemplate.Name = itemName; - itemTemplate.Folder = so.UUID; - itemTemplate.InvType = (int)InventoryType.LSL; - - m_scene.RezNewScript(userId, itemTemplate); - } - - private void OnChatFromWorld(object sender, OSChatMessage oscm) - { -// Console.WriteLine("Got chat [{0}]", oscm.Message); - - lock (m_osChatMessagesReceived) - { - m_osChatMessagesReceived.Add(oscm); - - if (m_osChatMessagesReceived.Count == m_expectedChatMessages) - m_chatEvent.Set(); - } - } - } -} \ No newline at end of file diff --git a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs deleted file mode 100644 index 1f220c0..0000000 --- a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading; -using log4net.Config; -using NUnit.Framework; -using OpenMetaverse; -using OpenMetaverse.Assets; -using OpenSim.Framework; -using OpenSim.Region.CoreModules.Scripting.DynamicTexture; -using OpenSim.Region.CoreModules.Scripting.VectorRender; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.Framework.Scenes.Serialization; -using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; - -namespace OpenSim.Tests.Stress -{ - [TestFixture] - public class VectorRenderModuleStressTests : OpenSimTestCase - { - public Scene Scene { get; private set; } - public DynamicTextureModule Dtm { get; private set; } - public VectorRenderModule Vrm { get; private set; } - - private void SetupScene(bool reuseTextures) - { - Scene = new SceneHelpers().SetupScene(); - - Dtm = new DynamicTextureModule(); - Dtm.ReuseTextures = reuseTextures; - - Vrm = new VectorRenderModule(); - - SceneHelpers.SetupSceneModules(Scene, Dtm, Vrm); - } - - [Test] - public void TestConcurrentRepeatedDraw() - { - int threads = 4; - TestHelpers.InMethod(); - - SetupScene(false); - - List drawers = new List(); - - for (int i = 0; i < threads; i++) - { - Drawer d = new Drawer(this, i); - drawers.Add(d); - Console.WriteLine("Starting drawer {0}", i); - Util.FireAndForget(o => d.Draw()); - } - - Thread.Sleep(10 * 60 * 1000); - - drawers.ForEach(d => d.Ready = false); - drawers.ForEach(d => Console.WriteLine("Drawer {0} drew {1} textures", d.Number, d.Pass + 1)); - } - - class Drawer - { - public int Number { get; private set; } - public int Pass { get; private set; } - public bool Ready { get; set; } - - private VectorRenderModuleStressTests m_tests; - - public Drawer(VectorRenderModuleStressTests tests, int number) - { - m_tests = tests; - Number = number; - Ready = true; - } - - public void Draw() - { - SceneObjectGroup so = SceneHelpers.AddSceneObject(m_tests.Scene); - - while (Ready) - { - UUID originalTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; - - // Ensure unique text - string text = string.Format("{0:D2}{1}", Number, Pass); - - m_tests.Dtm.AddDynamicTextureData( - m_tests.Scene.RegionInfo.RegionID, - so.UUID, - m_tests.Vrm.GetContentType(), - string.Format("PenColour BLACK; MoveTo 40,220; FontSize 32; Text {0};", text), - "", - 0); - - Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); - - Pass++; - } - } - } - } -} \ No newline at end of file diff --git a/OpenSim/Tests/Torture/NPCTortureTests.cs b/OpenSim/Tests/Torture/NPCTortureTests.cs new file mode 100644 index 0000000..731df68 --- /dev/null +++ b/OpenSim/Tests/Torture/NPCTortureTests.cs @@ -0,0 +1,190 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Reflection; +using log4net; +using Nini.Config; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.Avatar.Attachments; +using OpenSim.Region.CoreModules.Avatar.AvatarFactory; +using OpenSim.Region.CoreModules.Framework.InventoryAccess; +using OpenSim.Region.CoreModules.Framework.UserManagement; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.OptionalModules.World.NPC; +using OpenSim.Services.AvatarService; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; + +namespace OpenSim.Tests.Torture +{ + /// + /// NPC torture tests + /// + /// + /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached, + /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller + /// earlier tests. + /// + [TestFixture] + public class NPCTortureTests + { + private TestScene scene; + private AvatarFactoryModule afm; + private UserManagementModule umm; + private AttachmentsModule am; + + [TestFixtureSetUp] + public void FixtureInit() + { + // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread. + Util.FireAndForgetMethod = FireAndForgetMethod.None; + } + + [TestFixtureTearDown] + public void TearDown() + { + scene.Close(); + scene = null; + GC.Collect(); + GC.WaitForPendingFinalizers(); + + // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple + // threads. Possibly, later tests should be rewritten not to worry about such things. + Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod; + } + + [SetUp] + public void Init() + { + IConfigSource config = new IniConfigSource(); + config.AddConfig("NPC"); + config.Configs["NPC"].Set("Enabled", "true"); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + + afm = new AvatarFactoryModule(); + umm = new UserManagementModule(); + am = new AttachmentsModule(); + + scene = new SceneHelpers().SetupScene(); + SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule()); + } + + [Test] + public void Test_0001_AddRemove100NPCs() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddRemoveNPCs(100); + } + + [Test] + public void Test_0002_AddRemove1000NPCs() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddRemoveNPCs(1000); + } + + [Test] + public void Test_0003_AddRemove2000NPCs() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddRemoveNPCs(2000); + } + + private void TestAddRemoveNPCs(int numberOfNpcs) + { + ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); +// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); + + // 8 is the index of the first baked texture in AvatarAppearance + UUID originalFace8TextureId = TestHelpers.ParseTail(0x10); + Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero); + Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8); + originalTef.TextureID = originalFace8TextureId; + + // We also need to add the texture to the asset service, otherwise the AvatarFactoryModule will tell + // ScenePresence.SendInitialData() to reset our entire appearance. + scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); + + afm.SetAppearance(sp, originalTe, null); + + INPCModule npcModule = scene.RequestModuleInterface(); + + List npcs = new List(); + + long startGcMemory = GC.GetTotalMemory(true); + Stopwatch sw = new Stopwatch(); + sw.Start(); + + for (int i = 0; i < numberOfNpcs; i++) + { + npcs.Add( + npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, scene, sp.Appearance)); + } + + for (int i = 0; i < numberOfNpcs; i++) + { + Assert.That(npcs[i], Is.Not.Null); + + ScenePresence npc = scene.GetScenePresence(npcs[i]); + Assert.That(npc, Is.Not.Null); + } + + for (int i = 0; i < numberOfNpcs; i++) + { + Assert.That(npcModule.DeleteNPC(npcs[i], scene), Is.True); + ScenePresence npc = scene.GetScenePresence(npcs[i]); + Assert.That(npc, Is.Null); + } + + sw.Stop(); + + long endGcMemory = GC.GetTotalMemory(true); + + Console.WriteLine("Took {0} ms", sw.ElapsedMilliseconds); + Console.WriteLine( + "End {0} MB, Start {1} MB, Diff {2} MB", + endGcMemory / 1024 / 1024, + startGcMemory / 1024 / 1024, + (endGcMemory - startGcMemory) / 1024 / 1024); + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs new file mode 100644 index 0000000..195d47b --- /dev/null +++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs @@ -0,0 +1,175 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Diagnostics; +using System.Reflection; +using log4net; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; + +namespace OpenSim.Tests.Torture +{ + /// + /// Object torture tests + /// + /// + /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached, + /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller + /// earlier tests. + /// + [TestFixture] + public class ObjectTortureTests + { + [TearDown] + public void TearDown() + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + +// [Test] +// public void Test0000Clean() +// { +// TestHelpers.InMethod(); +//// log4net.Config.XmlConfigurator.Configure(); +// +// TestAddObjects(200000); +// } + + [Test] + public void Test_0001_10K_1PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(1, 10000); + } + + [Test] + public void Test_0002_100K_1PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(1, 100000); + } + + [Test] + public void Test_0003_200K_1PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(1, 200000); + } + + [Test] + public void Test_0011_100_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 100); + } + + [Test] + public void Test_0012_1K_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 1000); + } + + [Test] + public void Test_0013_2K_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 2000); + } + + private void TestAddObjects(int primsInEachObject, int objectsToAdd) + { + UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000"); + + // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage + // collected when we teardown this test. If it's done in a member variable, even if that is subsequently + // nulled out, the garbage collect can be delayed. + TestScene scene = new SceneHelpers().SetupScene(); + +// Process process = Process.GetCurrentProcess(); +// long startProcessMemory = process.PrivateMemorySize64; + long startGcMemory = GC.GetTotalMemory(true); + DateTime start = DateTime.Now; + + for (int i = 1; i <= objectsToAdd; i++) + { + SceneObjectGroup so = SceneHelpers.CreateSceneObject(primsInEachObject, ownerId, "part_", i); + Assert.That(scene.AddNewSceneObject(so, false), Is.True, string.Format("Object {0} was not created", i)); + } + + TimeSpan elapsed = DateTime.Now - start; +// long processMemoryAlloc = process.PrivateMemorySize64 - startProcessMemory; + long endGcMemory = GC.GetTotalMemory(false); + + for (int i = 1; i <= objectsToAdd; i++) + { + Assert.That( + scene.GetSceneObjectGroup(TestHelpers.ParseTail(i)), + Is.Not.Null, + string.Format("Object {0} could not be retrieved", i)); + } + + // When a scene object is added to a scene, it is placed in the update list for sending to viewers + // (though in this case we have none). When it is deleted, it is not removed from the update which is + // fine since it will later be ignored. + // + // However, that means that we need to manually run an update here to clear out that list so that deleted + // objects will be clean up by the garbage collector before the next stress test is run. + scene.Update(1); + + Console.WriteLine( + "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", + Math.Round(elapsed.TotalMilliseconds), + (endGcMemory - startGcMemory) / 1024 / 1024, + endGcMemory / 1024 / 1024, + startGcMemory / 1024 / 1024, + objectsToAdd, + primsInEachObject); + + scene.Close(); +// scene = null; + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Torture/ScriptTortureTests.cs b/OpenSim/Tests/Torture/ScriptTortureTests.cs new file mode 100644 index 0000000..24f278f --- /dev/null +++ b/OpenSim/Tests/Torture/ScriptTortureTests.cs @@ -0,0 +1,168 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Reflection; +using System.Threading; +using log4net; +using Nini.Config; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.CoreModules.Scripting.WorldComm; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.ScriptEngine.XEngine; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; + +namespace OpenSim.Tests.Torture +{ + /// + /// Script torture tests + /// + /// + /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached, + /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller + /// earlier tests. + /// + [TestFixture] + public class ScriptTortureTests + { + private TestScene m_scene; + private XEngine m_xEngine; + private AutoResetEvent m_chatEvent = new AutoResetEvent(false); + + private int m_expectedChatMessages; + private List m_osChatMessagesReceived = new List(); + + [SetUp] + public void Init() + { + //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin"); +// Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory); + m_xEngine = new XEngine(); + + // Necessary to stop serialization complaining + WorldCommModule wcModule = new WorldCommModule(); + + IniConfigSource configSource = new IniConfigSource(); + + IConfig startupConfig = configSource.AddConfig("Startup"); + startupConfig.Set("DefaultScriptEngine", "XEngine"); + + IConfig xEngineConfig = configSource.AddConfig("XEngine"); + xEngineConfig.Set("Enabled", "true"); + + // These tests will not run with AppDomainLoading = true, at least on mono. For unknown reasons, the call + // to AssemblyResolver.OnAssemblyResolve fails. + xEngineConfig.Set("AppDomainLoading", "false"); + + m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource); + SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule); + + m_scene.EventManager.OnChatFromWorld += OnChatFromWorld; + m_scene.StartScripts(); + } + + [TearDown] + public void TearDown() + { + m_scene.Close(); + m_scene = null; + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + + [Test] + public void TestCompileAndStart100Scripts() + { + TestHelpers.InMethod(); + log4net.Config.XmlConfigurator.Configure(); + + TestCompileAndStartScripts(100); + } + + private void TestCompileAndStartScripts(int scriptsToCreate) + { + UUID userId = TestHelpers.ParseTail(0x1); + + m_expectedChatMessages = scriptsToCreate; + int startingObjectIdTail = 0x100; + + GC.Collect(); + + for (int idTail = startingObjectIdTail;idTail < startingObjectIdTail + scriptsToCreate; idTail++) + { + AddObjectAndScript(idTail, userId); + } + + m_chatEvent.WaitOne(40000 + scriptsToCreate * 1000); + + Assert.That(m_osChatMessagesReceived.Count, Is.EqualTo(m_expectedChatMessages)); + + foreach (OSChatMessage msg in m_osChatMessagesReceived) + Assert.That( + msg.Message, + Is.EqualTo("Script running"), + string.Format( + "Message from {0} was {1} rather than {2}", msg.SenderUUID, msg.Message, "Script running")); + } + + private void AddObjectAndScript(int objectIdTail, UUID userId) + { +// UUID itemId = TestHelpers.ParseTail(0x3); + string itemName = string.Format("AddObjectAndScript() Item for object {0}", objectIdTail); + + SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, "AddObjectAndScriptPart_", objectIdTail); + m_scene.AddNewSceneObject(so, true); + + InventoryItemBase itemTemplate = new InventoryItemBase(); +// itemTemplate.ID = itemId; + itemTemplate.Name = itemName; + itemTemplate.Folder = so.UUID; + itemTemplate.InvType = (int)InventoryType.LSL; + + m_scene.RezNewScript(userId, itemTemplate); + } + + private void OnChatFromWorld(object sender, OSChatMessage oscm) + { +// Console.WriteLine("Got chat [{0}]", oscm.Message); + + lock (m_osChatMessagesReceived) + { + m_osChatMessagesReceived.Add(oscm); + + if (m_osChatMessagesReceived.Count == m_expectedChatMessages) + m_chatEvent.Set(); + } + } + } +} \ No newline at end of file -- cgit v1.1 From 5e0294815f7e3ec83b7e568e1468948ac0ff7331 Mon Sep 17 00:00:00 2001 From: teravus Date: Sat, 17 Nov 2012 03:47:09 -0500 Subject: * Plumbing and basic setting of the GetMesh Cap Throttler. * Last step is to flip the throttle distribution. --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 78bb18e..d1af0fc 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -521,6 +521,12 @@ namespace OpenSim.Tests.Common.Mock public virtual void SetChildAgentThrottle(byte[] throttle) { } + + public void SetAgentThrottleSilent(int throttle, int setting) + { + + + } public byte[] GetThrottlesPacked(float multiplier) { return new byte[0]; -- cgit v1.1 From 77cc7ce399d1b1a710f3b3f4337932febdef66c8 Mon Sep 17 00:00:00 2001 From: teravus Date: Fri, 21 Dec 2012 19:12:30 -0500 Subject: * Partial Commit for Avatar Appearance to include the functionality of Cached Bakes. --- OpenSim/Tests/Performance/NPCPerformanceTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Performance/NPCPerformanceTests.cs b/OpenSim/Tests/Performance/NPCPerformanceTests.cs index 627765b..afda574 100644 --- a/OpenSim/Tests/Performance/NPCPerformanceTests.cs +++ b/OpenSim/Tests/Performance/NPCPerformanceTests.cs @@ -144,7 +144,7 @@ namespace OpenSim.Tests.Performance // ScenePresence.SendInitialData() to reset our entire appearance. scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); - afm.SetAppearance(sp, originalTe, null); + afm.SetAppearance(sp, originalTe, null, new WearableCacheItem[0]); INPCModule npcModule = scene.RequestModuleInterface(); -- cgit v1.1 From f557d7e82821c931c6ca2faf97c668fa94cacfb0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Jan 2013 01:48:31 +0000 Subject: Add basic JsonCreateStore() regression test --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 214 ++++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/MockScriptEngine.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs new file mode 100644 index 0000000..51f2712 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -0,0 +1,214 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using OpenMetaverse; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.ScriptEngine.Interfaces; +using OpenSim.Region.ScriptEngine.Shared; + +namespace OpenSim.Tests.Common +{ + public class MockScriptEngine : INonSharedRegionModule, IScriptModule, IScriptEngine + { + private Scene m_scene; + + public void Initialise(IConfigSource source) + { + } + + public void Close() + { + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + + m_scene.StackModuleInterface(this); + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + } + + public string Name { get { return "Mock Script Engine"; } } + public string ScriptEngineName { get { return Name; } } + + public Type ReplaceableInterface { get { return null; } } + + public event ScriptRemoved OnScriptRemoved; + public event ObjectRemoved OnObjectRemoved; + + public string GetXMLState (UUID itemID) + { + throw new System.NotImplementedException (); + } + + public bool SetXMLState(UUID itemID, string xml) + { + throw new System.NotImplementedException (); + } + + public bool PostScriptEvent(UUID itemID, string name, object[] args) + { + throw new System.NotImplementedException (); + } + + public bool PostObjectEvent(UUID itemID, string name, object[] args) + { + throw new System.NotImplementedException (); + } + + public void SuspendScript(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void ResumeScript(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public ArrayList GetScriptErrors(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public bool HasScript(UUID itemID, out bool running) + { + throw new System.NotImplementedException (); + } + + public bool GetScriptState(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void SaveAllState() + { + throw new System.NotImplementedException (); + } + + public void StartProcessing() + { + throw new System.NotImplementedException (); + } + + public float GetScriptExecutionTime(List itemIDs) + { + throw new System.NotImplementedException (); + } + + public Dictionary GetObjectScriptsExecutionTimes() + { + throw new System.NotImplementedException (); + } + + public IScriptWorkItem QueueEventHandler(object parms) + { + throw new System.NotImplementedException (); + } + + public bool PostScriptEvent(UUID itemID,EventParams parms) + { + throw new System.NotImplementedException (); + } + + public bool PostObjectEvent (uint localID, EventParams parms) + { + throw new System.NotImplementedException (); + } + + public DetectParams GetDetectParams(UUID item, int number) + { + throw new System.NotImplementedException (); + } + + public void SetMinEventDelay(UUID itemID, double delay) + { + throw new System.NotImplementedException (); + } + + public int GetStartParameter(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void SetScriptState(UUID itemID, bool state) + { + throw new System.NotImplementedException (); + } + + public void SetState(UUID itemID, string newState) + { + throw new System.NotImplementedException (); + } + + public void ApiResetScript(UUID itemID) + { + throw new System.NotImplementedException (); + } + + public void ResetScript (UUID itemID) + { + throw new System.NotImplementedException (); + } + + public IScriptApi GetApi(UUID itemID, string name) + { + throw new System.NotImplementedException (); + } + + public Scene World { get { return m_scene; } } + + public IScriptModule ScriptModule { get { throw new System.NotImplementedException(); } } + + public IConfig Config { get { throw new System.NotImplementedException (); } } + + public IConfigSource ConfigSource { get { throw new System.NotImplementedException (); } } + + public string ScriptEnginePath { get { throw new System.NotImplementedException (); }} + + public string ScriptClassName { get { throw new System.NotImplementedException (); } } + + public string ScriptBaseClassName { get { throw new System.NotImplementedException (); } } + + public string[] ScriptReferencedAssemblies { get { throw new System.NotImplementedException (); } } + + public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } + } +} \ No newline at end of file -- cgit v1.1 From 145e38e5e9bed04d5c41880a5d508cab4603cc1d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Feb 2013 02:21:17 +0000 Subject: Remove long unused Scene.DumpAssetsToFile boolean. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index ea3e348..dc20f13 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -139,7 +139,7 @@ namespace OpenSim.Tests.Common SceneCommunicationService scs = new SceneCommunicationService(); TestScene testScene = new TestScene( - regInfo, m_acm, scs, m_simDataService, m_estateDataService, false, configSource, null); + regInfo, m_acm, scs, m_simDataService, m_estateDataService, configSource, null); INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index d4b5648..a7e0dfb 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -41,10 +41,9 @@ namespace OpenSim.Tests.Common.Mock public TestScene( RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, - bool dumpAssetsToFile, IConfigSource config, string simulatorVersion) : base(regInfo, authen, sceneGridService, simDataService, estateDataService, - dumpAssetsToFile, config, simulatorVersion) + config, simulatorVersion) { } -- cgit v1.1 From 3657a08844731e5a24eeda3195c23f417b4570a5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 7 Feb 2013 02:19:26 +0000 Subject: Add TestJsonWriteReadNotecard() regression test --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 51f2712..78bab5b 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -85,7 +85,7 @@ namespace OpenSim.Tests.Common public bool PostScriptEvent(UUID itemID, string name, object[] args) { - throw new System.NotImplementedException (); + return false; } public bool PostObjectEvent(UUID itemID, string name, object[] args) -- cgit v1.1 From 7bf33d333af6e7393a05940d1ab436f5dce73814 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Feb 2013 22:25:28 +0000 Subject: Plumb the path from the client to the extra physics params and back --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index dde37ab..182f4d9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1276,5 +1276,10 @@ namespace OpenSim.Tests.Common.Mock public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) { } + + public void SendPartPhysicsProprieties(ISceneEntity entity) + { + } + } } -- cgit v1.1 From e9cc22fea48a6d80fccbd624fd9710dfa3830980 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 16 Feb 2013 00:26:21 +0000 Subject: Add regression test TestSaveNonRootFolderToIar --- .../Tests/Common/Helpers/UserInventoryHelpers.cs | 109 +++++++++++++++++---- 1 file changed, 89 insertions(+), 20 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index 87d9410..a1794c9 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -45,6 +45,9 @@ namespace OpenSim.Tests.Common /// /// Add an existing scene object as an item in the user's inventory. /// + /// + /// Will be added to the system Objects folder. + /// /// /// /// @@ -63,7 +66,29 @@ namespace OpenSim.Tests.Common } /// - /// Creates a notecard in the objects folder and specify an item id. + /// Add an existing scene object as an item in the user's inventory at the given path. + /// + /// + /// + /// + /// + /// The inventory item created. + public static InventoryItemBase AddInventoryItem( + Scene scene, SceneObjectGroup so, int inventoryIdTail, int assetIdTail, string path) + { + return AddInventoryItem( + scene, + so.Name, + TestHelpers.ParseTail(inventoryIdTail), + InventoryType.Object, + AssetHelpers.CreateAsset(TestHelpers.ParseTail(assetIdTail), so), + so.OwnerID, + path); + } + + /// + /// Adds the given item to the existing system folder for its type (e.g. an object will go in the "Objects" + /// folder). /// /// /// @@ -75,6 +100,25 @@ namespace OpenSim.Tests.Common private static InventoryItemBase AddInventoryItem( Scene scene, string itemName, UUID itemId, InventoryType itemType, AssetBase asset, UUID userId) { + return AddInventoryItem( + scene, itemName, itemId, itemType, asset, userId, + scene.InventoryService.GetFolderForType(userId, (AssetType)asset.Type).Name); + } + + /// + /// Adds the given item to an inventory folder + /// + /// + /// + /// + /// + /// The serialized asset for this item + /// + /// Existing inventory path at which to add. + /// + private static InventoryItemBase AddInventoryItem( + Scene scene, string itemName, UUID itemId, InventoryType itemType, AssetBase asset, UUID userId, string path) + { scene.AssetService.Store(asset); InventoryItemBase item = new InventoryItemBase(); @@ -85,7 +129,7 @@ namespace OpenSim.Tests.Common item.AssetType = asset.Type; item.InvType = (int)itemType; - InventoryFolderBase folder = scene.InventoryService.GetFolderForType(userId, (AssetType)asset.Type); + InventoryFolderBase folder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, path)[0]; item.Folder = folder.ID; scene.AddInventoryItem(item); @@ -156,58 +200,83 @@ namespace OpenSim.Tests.Common /// /// Create inventory folders starting from the user's root folder. /// - /// - /// Ignores any existing folders with the same name - /// /// /// /// /// The folders to create. Multiple folders can be specified on a path delimited by the PATH_DELIMITER /// + /// + /// If true, then folders in the path which already the same name are + /// used. This applies to the terminal folder as well. + /// If false, then all folders in the path are created, even if there is already a folder at a particular + /// level with the same name. + /// /// /// The folder created. If the path contains multiple folders then the last one created is returned. /// Will return null if the root folder could not be found. /// public static InventoryFolderBase CreateInventoryFolder( - IInventoryService inventoryService, UUID userId, string path) + IInventoryService inventoryService, UUID userId, string path, bool useExistingFolders) { InventoryFolderBase rootFolder = inventoryService.GetRootFolder(userId); if (null == rootFolder) return null; - return CreateInventoryFolder(inventoryService, rootFolder, path); + return CreateInventoryFolder(inventoryService, rootFolder, path, useExistingFolders); } /// /// Create inventory folders starting from a given parent folder /// - /// - /// Ignores any existing folders with the same name - /// + /// + /// If any stem of the path names folders that already exist then these are not recreated. This includes the + /// final folder. + /// TODO: May need to make it an option to create duplicate folders. + /// /// /// /// - /// The folders to create. Multiple folders can be specified on a path delimited by the PATH_DELIMITER + /// The folder to create. + /// + /// + /// If true, then folders in the path which already the same name are + /// used. This applies to the terminal folder as well. + /// If false, then all folders in the path are created, even if there is already a folder at a particular + /// level with the same name. /// /// /// The folder created. If the path contains multiple folders then the last one created is returned. /// public static InventoryFolderBase CreateInventoryFolder( - IInventoryService inventoryService, InventoryFolderBase parentFolder, string path) + IInventoryService inventoryService, InventoryFolderBase parentFolder, string path, bool useExistingFolders) { string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); - InventoryFolderBase newFolder - = new InventoryFolderBase( - UUID.Random(), components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0); - - inventoryService.AddFolder(newFolder); + InventoryFolderBase folder = null; + + if (useExistingFolders) + folder = InventoryArchiveUtils.FindFolderByPath(inventoryService, parentFolder, components[0]); + + if (folder == null) + { +// Console.WriteLine("Creating folder {0} at {1}", components[0], parentFolder.Name); + + folder + = new InventoryFolderBase( + UUID.Random(), components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0); + + inventoryService.AddFolder(folder); + } +// else +// { +// Console.WriteLine("Found existing folder {0}", folder.Name); +// } if (components.Length > 1) - return CreateInventoryFolder(inventoryService, newFolder, components[1]); + return CreateInventoryFolder(inventoryService, folder, components[1], useExistingFolders); else - return newFolder; + return folder; } /// @@ -237,7 +306,7 @@ namespace OpenSim.Tests.Common /// An empty list if no matching folders were found public static List GetInventoryFolders(IInventoryService inventoryService, UUID userId, string path) { - return InventoryArchiveUtils.FindFolderByPath(inventoryService, userId, path); + return InventoryArchiveUtils.FindFoldersByPath(inventoryService, userId, path); } /// -- cgit v1.1 From b8a7c8b26f3005eed5b161c37509b06b1d604967 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 26 Feb 2013 23:36:36 +0000 Subject: Add regression test for llRequestUrl() --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 57 ++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 78bab5b..6a53fe7 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -40,10 +40,33 @@ namespace OpenSim.Tests.Common { public class MockScriptEngine : INonSharedRegionModule, IScriptModule, IScriptEngine { + public IConfigSource ConfigSource { get; private set; } + + public IConfig Config { get; private set; } + private Scene m_scene; + /// + /// Expose posted events to tests. + /// + public Dictionary> PostedEvents { get; private set; } + + /// + /// A very primitive way of hooking text cose to a posed event. + /// + /// + /// May be replaced with something that uses more original code in the future. + /// + public event Action PostEventHook; + public void Initialise(IConfigSource source) { + ConfigSource = source; + + // Can set later on if required + Config = new IniConfig("MockScriptEngine", ConfigSource); + + PostedEvents = new Dictionary>(); } public void Close() @@ -85,7 +108,28 @@ namespace OpenSim.Tests.Common public bool PostScriptEvent(UUID itemID, string name, object[] args) { - return false; +// Console.WriteLine("Posting event {0} for {1}", name, itemID); + + EventParams evParams = new EventParams(name, args, null); + + List eventsForItem; + + if (!PostedEvents.ContainsKey(itemID)) + { + eventsForItem = new List(); + PostedEvents.Add(itemID, eventsForItem); + } + else + { + eventsForItem = PostedEvents[itemID]; + } + + eventsForItem.Add(evParams); + + if (PostEventHook != null) + PostEventHook(itemID, evParams); + + return true; } public bool PostObjectEvent(UUID itemID, string name, object[] args) @@ -195,11 +239,7 @@ namespace OpenSim.Tests.Common public Scene World { get { return m_scene; } } - public IScriptModule ScriptModule { get { throw new System.NotImplementedException(); } } - - public IConfig Config { get { throw new System.NotImplementedException (); } } - - public IConfigSource ConfigSource { get { throw new System.NotImplementedException (); } } + public IScriptModule ScriptModule { get { return this; } } public string ScriptEnginePath { get { throw new System.NotImplementedException (); }} @@ -210,5 +250,10 @@ namespace OpenSim.Tests.Common public string[] ScriptReferencedAssemblies { get { throw new System.NotImplementedException (); } } public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } + + public void ClearPostedEvents() + { + PostedEvents.Clear(); + } } } \ No newline at end of file -- cgit v1.1 From ea4be309e83440fa3b4533b21ce33e5af07e796d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 26 Feb 2013 23:40:55 +0000 Subject: minor: remove warning in ConfigurationLoaderTest --- OpenSim/Tests/ConfigurationLoaderTest.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/ConfigurationLoaderTest.cs b/OpenSim/Tests/ConfigurationLoaderTest.cs index e5186ae..9d63324 100644 --- a/OpenSim/Tests/ConfigurationLoaderTest.cs +++ b/OpenSim/Tests/ConfigurationLoaderTest.cs @@ -47,6 +47,8 @@ namespace OpenSim.Tests [SetUp] public void SetUp() { + base.SetUp(); + m_basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); string path = Path.Combine(m_basePath, m_testSubdirectory); Directory.CreateDirectory(path); -- cgit v1.1 From 14684116f8ef23892b71ef16759224a536ac27bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 28 Feb 2013 20:57:03 +0000 Subject: Add regression tests for llGetNotecardLine() --- .../Tests/Common/Helpers/TaskInventoryHelpers.cs | 32 ++++++++++++++++++---- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 31 +++++++++++++-------- OpenSim/Tests/Common/TestHelpers.cs | 21 ++++++++++++++ OpenSim/Tests/ConfigurationLoaderTest.cs | 2 +- 4 files changed, 67 insertions(+), 19 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index 0a2b30a..bb4b55f 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -46,13 +46,32 @@ namespace OpenSim.Tests.Common /// /// /// + /// UUID or UUID stem + /// UUID or UUID stem + /// The tex to put in the notecard. + /// The item that was added + public static TaskInventoryItem AddNotecard( + Scene scene, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text) + { + return AddNotecard( + scene, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text); + } + + /// + /// Add a notecard item to the given part. + /// + /// + /// + /// /// /// + /// The tex to put in the notecard. /// The item that was added - public static TaskInventoryItem AddNotecard(Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID) + public static TaskInventoryItem AddNotecard( + Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text) { AssetNotecard nc = new AssetNotecard(); - nc.BodyText = "Hello World!"; + nc.BodyText = text; nc.Encode(); AssetBase ncAsset @@ -87,8 +106,8 @@ namespace OpenSim.Tests.Common /// Add a simple script to the given part. /// /// - /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these - /// functions more than once in a test. + /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather + /// than a random component. /// /// /// @@ -102,8 +121,9 @@ namespace OpenSim.Tests.Common ast.Source = scriptSource; ast.Encode(); - UUID assetUuid = new UUID("00000000-0000-0000-1000-000000000000"); - UUID itemUuid = new UUID("00000000-0000-0000-1100-000000000000"); + UUID assetUuid = UUID.Random(); + UUID itemUuid = UUID.Random(); + AssetBase asset = AssetHelpers.CreateAsset(assetUuid, AssetType.LSLText, ast.AssetData, UUID.Zero); scene.AssetService.Store(asset); diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 6a53fe7..b444241 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Reflection; using Nini.Config; using OpenMetaverse; +using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.ScriptEngine.Interfaces; @@ -110,8 +111,11 @@ namespace OpenSim.Tests.Common { // Console.WriteLine("Posting event {0} for {1}", name, itemID); - EventParams evParams = new EventParams(name, args, null); + return PostScriptEvent(itemID, new EventParams(name, args, null)); + } + public bool PostScriptEvent(UUID itemID, EventParams evParams) + { List eventsForItem; if (!PostedEvents.ContainsKey(itemID)) @@ -132,9 +136,22 @@ namespace OpenSim.Tests.Common return true; } + public bool PostObjectEvent(uint localID, EventParams evParams) + { + return PostObjectEvent(m_scene.GetSceneObjectPart(localID), evParams); + } + public bool PostObjectEvent(UUID itemID, string name, object[] args) { - throw new System.NotImplementedException (); + return PostObjectEvent(m_scene.GetSceneObjectPart(itemID), new EventParams(name, args, null)); + } + + private bool PostObjectEvent(SceneObjectPart part, EventParams evParams) + { + foreach (TaskInventoryItem item in part.Inventory.GetInventoryItems(InventoryType.LSL)) + PostScriptEvent(item.ItemID, evParams); + + return true; } public void SuspendScript(UUID itemID) @@ -187,16 +204,6 @@ namespace OpenSim.Tests.Common throw new System.NotImplementedException (); } - public bool PostScriptEvent(UUID itemID,EventParams parms) - { - throw new System.NotImplementedException (); - } - - public bool PostObjectEvent (uint localID, EventParams parms) - { - throw new System.NotImplementedException (); - } - public DetectParams GetDetectParams(UUID item, int number) { throw new System.NotImplementedException (); diff --git a/OpenSim/Tests/Common/TestHelpers.cs b/OpenSim/Tests/Common/TestHelpers.cs index 57da802..a684d72 100644 --- a/OpenSim/Tests/Common/TestHelpers.cs +++ b/OpenSim/Tests/Common/TestHelpers.cs @@ -114,6 +114,27 @@ namespace OpenSim.Tests.Common } /// + /// Parse a UUID stem into a full UUID. + /// + /// + /// Yes, this is completely inconsistent with ParseTail but this is probably a better way to do it, + /// UUIDs are conceptually not hexadecmial numbers. + /// The fragment will come at the start of the UUID. The rest will be 0s + /// + /// + /// + /// A UUID fragment that will be parsed into a full UUID. Therefore, it can only contain + /// cahracters which are valid in a UUID, except for "-" which is currently only allowed if a full UUID is + /// given as the 'fragment'. + /// + public static UUID ParseStem(string stem) + { + string rawUuid = stem.PadRight(32, '0'); + + return UUID.Parse(rawUuid); + } + + /// /// Parse tail section into full UUID. /// /// diff --git a/OpenSim/Tests/ConfigurationLoaderTest.cs b/OpenSim/Tests/ConfigurationLoaderTest.cs index 9d63324..a409a13 100644 --- a/OpenSim/Tests/ConfigurationLoaderTest.cs +++ b/OpenSim/Tests/ConfigurationLoaderTest.cs @@ -45,7 +45,7 @@ namespace OpenSim.Tests /// Set up a test directory. /// [SetUp] - public void SetUp() + public override void SetUp() { base.SetUp(); -- cgit v1.1 From 8960418e7d51a0f861e7b4cb800f007d76862c9c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Mar 2013 21:37:53 +0000 Subject: Add regression test for presence crossing between regions on the same simulator. Unlike a much earlier commented out version of this test, this is done in synchronous mode. --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 182f4d9..a448cc5 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -60,6 +60,8 @@ namespace OpenSim.Tests.Common.Mock public List SentImagePacketPackets { get; private set; } public List SentImageNotInDatabasePackets { get; private set; } + public event Action OnReceivedMoveAgentIntoRegion; + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -566,6 +568,8 @@ namespace OpenSim.Tests.Common.Mock public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) { + if (OnReceivedMoveAgentIntoRegion != null) + OnReceivedMoveAgentIntoRegion(regInfo, pos, look); } public virtual AgentCircuitData RequestClientInfo() -- cgit v1.1 From 5751ecde5250484fe8e4b79ef38bfbf441e3dead Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 6 Mar 2013 23:06:00 +0000 Subject: Add code for testing event queue messages recevied on region cross. This is currently disabled pending an improvement in the test code to properly add avatars when an event queue module is present. --- .../Tests/Common/Mock/TestEventQueueGetModule.cs | 178 +++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs new file mode 100644 index 0000000..6707019 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -0,0 +1,178 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Net; +using System.Reflection; +using System.Threading; +using log4net; +using Nini.Config; +using Mono.Addins; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; +using OpenSim.Framework.Servers; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Tests.Common +{ + public class TestEventQueueGetModule : IEventQueue, INonSharedRegionModule + { + public class Event + { + public string Name { get; set; } + public object[] Args { get; set; } + + public Event(string name, object[] args) + { + name = Name; + args = Args; + } + } + + public Dictionary> Events { get; set; } + + public void Initialise(IConfigSource source) {} + + public void Close() {} + + public void AddRegion(Scene scene) + { + Events = new Dictionary>(); + scene.RegisterModuleInterface(this); + } + + public void RemoveRegion (Scene scene) {} + + public void RegionLoaded (Scene scene) {} + + public string Name { get { return "TestEventQueueGetModule"; } } + + public Type ReplaceableInterface { get { return null; } } + + private void AddEvent(UUID avatarID, string name, params object[] args) + { + Console.WriteLine("Adding event {0} for {1}", name, avatarID); + + List avEvents; + + if (!Events.ContainsKey(avatarID)) + { + avEvents = new List(); + Events[avatarID] = avEvents; + } + else + { + avEvents = Events[avatarID]; + } + + avEvents.Add(new Event(name, args)); + } + + public void ClearEvents() + { + if (Events != null) + Events.Clear(); + } + + public bool Enqueue(OSD o, UUID avatarID) + { + AddEvent(avatarID, "Enqueue", o); + return true; + } + + public void DisableSimulator(ulong handle, UUID avatarID) + { + AddEvent(avatarID, "DisableSimulator", handle); + } + + public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID) + { + AddEvent(avatarID, "EnableSimulator", handle); + } + + public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath) + { + AddEvent(avatarID, "EstablishAgentCommunication", endPoint, capsPath); + } + + public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, UUID agentID) + { + AddEvent(agentID, "TeleportFinishEvent", regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); + } + + public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL, UUID avatarID, UUID sessionID) + { + AddEvent(avatarID, "CrossRegion", handle, pos, lookAt, newRegionExternalEndPoint, capsURL, sessionID); + } + + public void ChatterboxInvitation( + UUID sessionID, string sessionName, UUID fromAgent, string message, UUID toAgent, string fromName, + byte dialog, uint timeStamp, bool offline, int parentEstateID, Vector3 position, uint ttl, + UUID transactionID, bool fromGroup, byte[] binaryBucket) + { + AddEvent( + toAgent, "ChatterboxInvitation", sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog, + timeStamp, offline, parentEstateID, position, ttl, transactionID, fromGroup, binaryBucket); + } + + public void ChatterBoxSessionAgentListUpdates (UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, bool isModerator, bool textMute) + { + AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute); + } + + public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) + { + AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); + } + + public void GroupMembership (OpenMetaverse.Packets.AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) + { + AddEvent(avatarID, "GroupMembership", groupUpdate); + } + + public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono) + { + Console.WriteLine("ONE"); + throw new System.NotImplementedException (); + } + + public OSD BuildEvent (string eventName, OSD eventBody) + { + Console.WriteLine("TWO"); + throw new System.NotImplementedException (); + } + + public void partPhysicsProperties (uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID) + { + AddEvent(avatarID, "partPhysicsProperties", localID, physhapetype, density, friction, bounce, gravmod); + } + } +} \ No newline at end of file -- cgit v1.1 From c1115e4c2e8a35fee3287add748881f3718deba5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Mar 2013 22:56:26 +0000 Subject: Add ILandChannel.GetLandObject(Vector3 position) as this is a very common input to GetLandObject() This conforms to the existing ILandChannel.ParcelsNearPoint() method --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 4b4d52d..3115035 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -81,6 +81,11 @@ namespace OpenSim.Tests.Common.Mock return obj; } + public ILandObject GetLandObject(Vector3 position) + { + return GetLandObject(position.X, position.Y); + } + public ILandObject GetLandObject(int x, int y) { return GetNoLand(); -- cgit v1.1 From 36651bed71ce1011c376078943a4fef7e8a9ada6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 23:01:16 +0000 Subject: On the later forms of teleport failure, tell the user if this was because viewer couldn't/didn't connect with destination or if destination didn't signal teleport completion. Also adds regression test for the case where the viewer couldn't connect with the destination region. Also refactoring of regression test support code associated with entity transfer in order to make this test possible and the code less obscure. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 37 +++++++++++++++++++++++----- OpenSim/Tests/Common/Mock/TestClient.cs | 29 +++------------------- 2 files changed, 35 insertions(+), 31 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index dc20f13..bdd9093 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -532,6 +532,31 @@ namespace OpenSim.Tests.Common /// public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData, SceneManager sceneManager) { + return AddScenePresence(scene, new TestClient(agentData, scene, sceneManager), agentData, sceneManager); + } + + /// + /// Add a root agent. + /// + /// + /// This function + /// + /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the + /// userserver if grid) would give initial login data back to the client and separately tell the scene that the + /// agent was coming. + /// + /// 2) Connects the agent with the scene + /// + /// This function performs actions equivalent with notifying the scene that an agent is + /// coming and then actually connecting the agent to the scene. The one step missed out is the very first + /// + /// + /// + /// + /// + public static ScenePresence AddScenePresence( + Scene scene, IClientAPI client, AgentCircuitData agentData, SceneManager sceneManager) + { // We emulate the proper login sequence here by doing things in four stages // Stage 0: login @@ -541,7 +566,7 @@ namespace OpenSim.Tests.Common lpsc.m_PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID); // Stages 1 & 2 - ScenePresence sp = IntroduceClientToScene(scene, sceneManager, agentData, TeleportFlags.ViaLogin); + ScenePresence sp = IntroduceClientToScene(scene, client, agentData, TeleportFlags.ViaLogin); // Stage 3: Complete the entrance into the region. This converts the child agent into a root agent. sp.CompleteMovement(sp.ControllingClient, true); @@ -558,11 +583,11 @@ namespace OpenSim.Tests.Common /// neighbours and where no teleporting takes place. /// /// - /// /// /// private static ScenePresence IntroduceClientToScene( - Scene scene, SceneManager sceneManager, AgentCircuitData agentData, TeleportFlags tf) + Scene scene, IClientAPI client, AgentCircuitData agentData, TeleportFlags tf) { string reason; @@ -571,10 +596,9 @@ namespace OpenSim.Tests.Common Console.WriteLine("NewUserConnection failed: " + reason); // Stage 2: add the new client as a child agent to the scene - TestClient client = new TestClient(agentData, scene, sceneManager); scene.AddNewClient(client, PresenceType.User); - return scene.GetScenePresence(agentData.AgentID); + return scene.GetScenePresence(client.AgentId); } public static ScenePresence AddChildScenePresence(Scene scene, UUID agentId) @@ -583,7 +607,8 @@ namespace OpenSim.Tests.Common acd.child = true; // XXX: ViaLogin may not be correct for child agents - return IntroduceClientToScene(scene, null, acd, TeleportFlags.ViaLogin); + TestClient client = new TestClient(acd, scene, null); + return IntroduceClientToScene(scene, client, acd, TeleportFlags.ViaLogin); } /// diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a448cc5..2d4fef1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -46,8 +46,6 @@ namespace OpenSim.Tests.Common.Mock EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); - private TestClient TeleportSceneClient; - private Scene m_scene; private SceneManager m_sceneManager; @@ -60,7 +58,9 @@ namespace OpenSim.Tests.Common.Mock public List SentImagePacketPackets { get; private set; } public List SentImageNotInDatabasePackets { get; private set; } + // Test client specific events - for use by tests to implement some IClientAPI behaviour. public event Action OnReceivedMoveAgentIntoRegion; + public event Action OnTestClientInformClientOfNeighbour; // disable warning: public events, part of the public API #pragma warning disable 67 @@ -595,23 +595,8 @@ namespace OpenSim.Tests.Common.Mock public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) { - m_log.DebugFormat("[TEST CLIENT]: Processing inform client of neighbour"); - - // In response to this message, we are going to make a teleport to the scene we've previous been told - // about by test code (this needs to be improved). - AgentCircuitData newAgent = RequestClientInfo(); - - // Stage 2: add the new client as a child agent to the scene - uint x, y; - Utils.LongToUInts(neighbourHandle, out x, out y); - x /= Constants.RegionSize; - y /= Constants.RegionSize; - - Scene neighbourScene; - m_sceneManager.TryGetScene(x, y, out neighbourScene); - - TeleportSceneClient = new TestClient(newAgent, neighbourScene, m_sceneManager); - neighbourScene.AddNewClient(TeleportSceneClient, PresenceType.User); + if (OnTestClientInformClientOfNeighbour != null) + OnTestClientInformClientOfNeighbour(neighbourHandle, neighbourExternalEndPoint); } public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, @@ -626,12 +611,6 @@ namespace OpenSim.Tests.Common.Mock // CompleteTeleportClientSide(); } - public void CompleteTeleportClientSide() - { - TeleportSceneClient.CompleteMovement(); - //TeleportTargetScene.AgentCrossing(newAgent.AgentID, new Vector3(90, 90, 90), false); - } - public virtual void SendTeleportFailed(string reason) { m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); -- cgit v1.1 From 16af5b87f888821d60b8068dde4acac58a6066f7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 20 Mar 2013 23:08:35 +0000 Subject: Add file missing from last commit 36651be --- .../Tests/Common/Helpers/EntityTransferHelpers.cs | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs new file mode 100644 index 0000000..6cc7ff2 --- /dev/null +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -0,0 +1,91 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using log4net; +using Nini.Config; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Servers; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.CoreModules.Framework; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; + +namespace OpenSim.Tests.Common +{ + public static class EntityTransferHelpers + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + /// + /// Set up correct handling of the InformClientOfNeighbour call from the source region that triggers the + /// viewer to setup a connection with the destination region. + /// + /// + /// + /// A list that will be populated with any TestClients set up in response to + /// being informed about a destination region. + /// + public static void SetUpInformClientOfNeighbour(TestClient tc, List neighbourTcs) + { + // XXX: Confusingly, this is also used for non-neighbour notification (as in teleports that do not use the + // event queue). + + tc.OnTestClientInformClientOfNeighbour += (neighbourHandle, neighbourExternalEndPoint) => + { + uint x, y; + Utils.LongToUInts(neighbourHandle, out x, out y); + x /= Constants.RegionSize; + y /= Constants.RegionSize; + + m_log.DebugFormat( + "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}", + x, y, neighbourExternalEndPoint); + + // In response to this message, we are going to make a teleport to the scene we've previous been told + // about by test code (this needs to be improved). + AgentCircuitData newAgent = tc.RequestClientInfo(); + + Scene neighbourScene; + SceneManager.Instance.TryGetScene(x, y, out neighbourScene); + + TestClient neighbourTc = new TestClient(newAgent, neighbourScene, SceneManager.Instance); + neighbourTcs.Add(neighbourTc); + neighbourScene.AddNewClient(neighbourTc, PresenceType.User); + }; + } + } +} \ No newline at end of file -- cgit v1.1 From 6571e7ead276027e5ed86cb1fc9d1b47ddae2e6e Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 22 Apr 2013 22:24:41 +0200 Subject: Allow callers to set the invoice parameter for GenericMessage --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4a1380d..07de06c 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -550,12 +550,12 @@ namespace OpenSim.Tests.Common.Mock } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, UUID invoice, List message) { } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, UUID invoice, List message) { } -- cgit v1.1 From 293a024c141d3567d42169f625bc449b89a1b59d Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 22 Apr 2013 22:24:41 +0200 Subject: Allow callers to set the invoice parameter for GenericMessage --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2d4fef1..d26e3f7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -541,12 +541,12 @@ namespace OpenSim.Tests.Common.Mock } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, UUID invoice, List message) { } - public void SendGenericMessage(string method, List message) + public void SendGenericMessage(string method, UUID invoice, List message) { } -- cgit v1.1 From a7cbb9edc98fabc6d2705d69310f4356e84c7596 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Apr 2013 20:50:49 +0100 Subject: Add regression test for offer, accept and subsequent receiver delete of an item offered via instant message. --- OpenSim/Tests/Common/Mock/TestClient.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d26e3f7..b7a7463 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -484,6 +484,18 @@ namespace OpenSim.Tests.Common.Mock OnCompleteMovementToRegion(this, true); } + /// + /// Emulate sending an IM from the viewer to the simulator. + /// + /// + public void HandleImprovedInstantMessage(GridInstantMessage im) + { + ImprovedInstantMessage handlerInstantMessage = OnInstantMessage; + + if (handlerInstantMessage != null) + handlerInstantMessage(this, im); + } + public virtual void ActivateGesture(UUID assetId, UUID gestureId) { } -- cgit v1.1 From 0beccf23c0c2e7b2420f4f150d5f2566f0d63370 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Apr 2013 21:11:44 +0100 Subject: Add regression test for inventory item give, reject and subsequent trash folder purge by receiver. This commit also actually adds the InventoryTransferModuleTests file which I previously forgot --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b7a7463..41402a4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -61,6 +61,7 @@ namespace OpenSim.Tests.Common.Mock // Test client specific events - for use by tests to implement some IClientAPI behaviour. public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; + public event Action OnReceivedInstantMessage; // disable warning: public events, part of the public API #pragma warning disable 67 @@ -550,7 +551,8 @@ namespace OpenSim.Tests.Common.Mock public void SendInstantMessage(GridInstantMessage im) { - + if (OnReceivedInstantMessage != null) + OnReceivedInstantMessage(im); } public void SendGenericMessage(string method, UUID invoice, List message) -- cgit v1.1 From 67789201c3ae40bd4697f3479eb183599baa3658 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Apr 2013 22:14:13 +0100 Subject: Add TestRejectGivenFolder() and TestAcceptGivenFolder() regression tests --- .../Tests/Common/Helpers/UserInventoryHelpers.cs | 41 +++++++++++++++++++--- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 28 ++++++++++++++- 2 files changed, 64 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index a1794c9..b3b75af 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -218,12 +218,37 @@ namespace OpenSim.Tests.Common public static InventoryFolderBase CreateInventoryFolder( IInventoryService inventoryService, UUID userId, string path, bool useExistingFolders) { + return CreateInventoryFolder(inventoryService, userId, UUID.Random(), path, useExistingFolders); + } + + /// + /// Create inventory folders starting from the user's root folder. + /// + /// + /// + /// + /// + /// The folders to create. Multiple folders can be specified on a path delimited by the PATH_DELIMITER + /// + /// + /// If true, then folders in the path which already the same name are + /// used. This applies to the terminal folder as well. + /// If false, then all folders in the path are created, even if there is already a folder at a particular + /// level with the same name. + /// + /// + /// The folder created. If the path contains multiple folders then the last one created is returned. + /// Will return null if the root folder could not be found. + /// + public static InventoryFolderBase CreateInventoryFolder( + IInventoryService inventoryService, UUID userId, UUID folderId, string path, bool useExistingFolders) + { InventoryFolderBase rootFolder = inventoryService.GetRootFolder(userId); if (null == rootFolder) return null; - return CreateInventoryFolder(inventoryService, rootFolder, path, useExistingFolders); + return CreateInventoryFolder(inventoryService, folderId, rootFolder, path, useExistingFolders); } /// @@ -235,6 +260,7 @@ namespace OpenSim.Tests.Common /// TODO: May need to make it an option to create duplicate folders. /// /// + /// ID of the folder to create /// /// /// The folder to create. @@ -249,7 +275,7 @@ namespace OpenSim.Tests.Common /// The folder created. If the path contains multiple folders then the last one created is returned. /// public static InventoryFolderBase CreateInventoryFolder( - IInventoryService inventoryService, InventoryFolderBase parentFolder, string path, bool useExistingFolders) + IInventoryService inventoryService, UUID folderId, InventoryFolderBase parentFolder, string path, bool useExistingFolders) { string[] components = path.Split(new string[] { PATH_DELIMITER }, 2, StringSplitOptions.None); @@ -262,9 +288,16 @@ namespace OpenSim.Tests.Common { // Console.WriteLine("Creating folder {0} at {1}", components[0], parentFolder.Name); + UUID folderIdForCreate; + + if (components.Length > 1) + folderIdForCreate = UUID.Random(); + else + folderIdForCreate = folderId; + folder = new InventoryFolderBase( - UUID.Random(), components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0); + folderIdForCreate, components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0); inventoryService.AddFolder(folder); } @@ -274,7 +307,7 @@ namespace OpenSim.Tests.Common // } if (components.Length > 1) - return CreateInventoryFolder(inventoryService, folder, components[1], useExistingFolders); + return CreateInventoryFolder(inventoryService, folderId, folder, components[1], useExistingFolders); else return folder; } diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index ccbdf81..30b1f38 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -53,6 +53,9 @@ namespace OpenSim.Tests.Common.Mock public XInventoryFolder[] GetFolders(string[] fields, string[] vals) { +// Console.WriteLine( +// "Requesting folders, fields {0}, vals {1}", string.Join(",", fields), string.Join(",", vals)); + List origFolders = Get(fields, vals, m_allFolders.Values.ToList()); @@ -104,7 +107,30 @@ namespace OpenSim.Tests.Common.Mock } public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } - public bool MoveFolder(string id, string newParent) { throw new NotImplementedException(); } + + public bool MoveFolder(string id, string newParent) + { + // Don't use GetFolders() here - it takes a clone! + XInventoryFolder folder = m_allFolders[new UUID(id)]; + + if (folder == null) + return false; + + folder.parentFolderID = new UUID(newParent); + + XInventoryFolder[] newParentFolders + = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); + +// Console.WriteLine( +// "Moved folder {0} {1}, to {2} {3}", +// folder.folderName, folder.folderID, newParentFolders[0].folderName, folder.parentFolderID); + + // TODO: Really need to implement folder version incrementing, though this should be common code anyway, + // not reimplemented in each db plugin. + + return true; + } + public XInventoryItem[] GetActiveGestures(UUID principalID) { throw new NotImplementedException(); } public int GetAssetPermissions(UUID principalID, UUID assetID) { throw new NotImplementedException(); } } -- cgit v1.1 From 33aaa40bee37ca4d8a3afa10fbbea7c1be3a1d58 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 8 May 2013 13:13:51 -0700 Subject: Adds an event and a method so that handling of the CachedTexture packet can be pulled out of LLClientView and moved to AvatarFactory. The first pass at reusing textures (turned off by default) is included. When reusing textures, if the baked textures from a previous login are still in the asset service (which generally means that they are in the simulator's cache) then the avatar will not need to rebake. This is both a performance improvement (specifically that an avatars baked textures do not need to be sent to other users who have the old textures cached) and a resource improvement (don't have to deal with duplicate bakes in the asset service cache). --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 41402a4..664ecb6 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -196,6 +196,7 @@ namespace OpenSim.Tests.Common.Mock public event EstateCovenantRequest OnEstateCovenantRequest; public event EstateChangeInfo OnEstateChangeInfo; public event EstateManageTelehub OnEstateManageTelehub; + public event CachedTextureRequest OnCachedTextureRequest; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; @@ -509,6 +510,11 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendCachedTextureResponse(ISceneEntity avatar, int serial, List cachedTextures) + { + + } + public virtual void Kick(string message) { } -- cgit v1.1 From 2cb2f1d7e30fa583a9f43ddd6b420deb8e9b56bd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 9 May 2013 18:02:19 +0100 Subject: Fix issue where objects removed via llDie() would not disappear for users looking in from neighbouring sims. This was because this particular code path (unlike user delete) only sent kills to root presences, for no apparent good reason. Added regression test for this case. This fixes http://opensimulator.org/mantis/view.php?id=6627 --- .../Tests/Common/Helpers/EntityTransferHelpers.cs | 2 +- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 54 ++-------------------- OpenSim/Tests/Common/Mock/TestClient.cs | 20 ++------ 3 files changed, 9 insertions(+), 67 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index 6cc7ff2..1b960b1 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -82,7 +82,7 @@ namespace OpenSim.Tests.Common Scene neighbourScene; SceneManager.Instance.TryGetScene(x, y, out neighbourScene); - TestClient neighbourTc = new TestClient(newAgent, neighbourScene, SceneManager.Instance); + TestClient neighbourTc = new TestClient(newAgent, neighbourScene); neighbourTcs.Add(neighbourTc); neighbourScene.AddNewClient(neighbourTc, PresenceType.User); }; diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index bdd9093..d9bb85e 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -447,9 +447,6 @@ namespace OpenSim.Tests.Common /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test /// /// - /// This can be used for tests where there is only one region or where there are multiple non-neighbour regions - /// and teleport doesn't take place. - /// /// XXX: Use the version of this method that takes the UserAccount structure wherever possible - this will /// make the agent circuit data (e.g. first, lastname) consistent with the user account data. /// @@ -462,22 +459,6 @@ namespace OpenSim.Tests.Common } /// - /// Add a root agent where the details of the agent connection (apart from the id) are unimportant for the test - /// - /// - /// XXX: Use the version of this method that takes the UserAccount structure wherever possible - this will - /// make the agent circuit data (e.g. first, lastname) consistent with the user account data. - /// - /// - /// - /// - /// - public static ScenePresence AddScenePresence(Scene scene, UUID agentId, SceneManager sceneManager) - { - return AddScenePresence(scene, GenerateAgentData(agentId), sceneManager); - } - - /// /// Add a root agent. /// /// @@ -508,31 +489,7 @@ namespace OpenSim.Tests.Common /// public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData) { - return AddScenePresence(scene, agentData, null); - } - - /// - /// Add a root agent. - /// - /// - /// This function - /// - /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the - /// userserver if grid) would give initial login data back to the client and separately tell the scene that the - /// agent was coming. - /// - /// 2) Connects the agent with the scene - /// - /// This function performs actions equivalent with notifying the scene that an agent is - /// coming and then actually connecting the agent to the scene. The one step missed out is the very first - /// - /// - /// - /// - /// - public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData, SceneManager sceneManager) - { - return AddScenePresence(scene, new TestClient(agentData, scene, sceneManager), agentData, sceneManager); + return AddScenePresence(scene, new TestClient(agentData, scene), agentData); } /// @@ -552,10 +509,9 @@ namespace OpenSim.Tests.Common /// /// /// - /// /// public static ScenePresence AddScenePresence( - Scene scene, IClientAPI client, AgentCircuitData agentData, SceneManager sceneManager) + Scene scene, IClientAPI client, AgentCircuitData agentData) { // We emulate the proper login sequence here by doing things in four stages @@ -578,10 +534,6 @@ namespace OpenSim.Tests.Common /// Introduce an agent into the scene by adding a new client. /// /// The scene presence added - /// - /// Scene manager. Can be null if there is only one region in the test or multiple regions that are not - /// neighbours and where no teleporting takes place. - /// /// /// /// @@ -607,7 +559,7 @@ namespace OpenSim.Tests.Common acd.child = true; // XXX: ViaLogin may not be correct for child agents - TestClient client = new TestClient(acd, scene, null); + TestClient client = new TestClient(acd, scene); return IntroduceClientToScene(scene, client, acd, TeleportFlags.ViaLogin); } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 664ecb6..3f9690f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -47,9 +47,9 @@ namespace OpenSim.Tests.Common.Mock EventWaitHandle wh = new EventWaitHandle (false, EventResetMode.AutoReset, "Crossing"); private Scene m_scene; - private SceneManager m_sceneManager; // Properties so that we can get at received data for test purposes + public List ReceivedKills { get; private set; } public List ReceivedOfflineNotifications { get; private set; } public List ReceivedOnlineNotifications { get; private set; } public List ReceivedFriendshipTerminations { get; private set; } @@ -434,33 +434,21 @@ namespace OpenSim.Tests.Common.Mock /// /// Constructor /// - /// - /// Can be used for a test where there is only one region or where there are multiple regions that are not - /// neighbours and where no teleporting takes place. In other situations, the constructor that takes in a - /// scene manager should be used. - /// - /// - /// - public TestClient(AgentCircuitData agentData, Scene scene) : this(agentData, scene, null) {} - - /// - /// Constructor - /// /// /// /// - public TestClient(AgentCircuitData agentData, Scene scene, SceneManager sceneManager) + public TestClient(AgentCircuitData agentData, Scene scene) { m_agentId = agentData.AgentID; m_firstName = agentData.firstname; m_lastName = agentData.lastname; m_circuitCode = agentData.circuitcode; m_scene = scene; - m_sceneManager = sceneManager; SessionId = agentData.SessionID; SecureSessionId = agentData.SecureSessionID; CapsSeedUrl = agentData.CapsPath; + ReceivedKills = new List(); ReceivedOfflineNotifications = new List(); ReceivedOnlineNotifications = new List(); ReceivedFriendshipTerminations = new List(); @@ -534,11 +522,13 @@ namespace OpenSim.Tests.Common.Mock public virtual void SendKillObject(ulong regionHandle, List localID) { + ReceivedKills.AddRange(localID); } public virtual void SetChildAgentThrottle(byte[] throttle) { } + public byte[] GetThrottlesPacked(float multiplier) { return new byte[0]; -- cgit v1.1 From 3290cd09d3ecd45c52bd131ada2a793c48fd99dc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 9 May 2013 18:12:17 +0100 Subject: remove pointless region handle paramter from IClientAPI.SendKillObject() --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 3f9690f..09e751a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -517,10 +517,9 @@ namespace OpenSim.Tests.Common.Mock public virtual void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) { - } - public virtual void SendKillObject(ulong regionHandle, List localID) + public virtual void SendKillObject(List localID) { ReceivedKills.AddRange(localID); } @@ -534,7 +533,6 @@ namespace OpenSim.Tests.Common.Mock return new byte[0]; } - public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) { } -- cgit v1.1 From 292a6037add00c9e8f817c733d8fc375806caf99 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 9 May 2013 22:48:10 +0100 Subject: minor: Remove unnecessary code that was generating warning in TestXInventoryDataPlugin --- OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index 30b1f38..2be5524 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -118,8 +118,8 @@ namespace OpenSim.Tests.Common.Mock folder.parentFolderID = new UUID(newParent); - XInventoryFolder[] newParentFolders - = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); +// XInventoryFolder[] newParentFolders +// = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); // Console.WriteLine( // "Moved folder {0} {1}, to {2} {3}", -- cgit v1.1 From 533bbf033df88fd231eb0e7d2b0aa5a0058163ea Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 25 May 2013 02:08:54 +0100 Subject: Update the money framework to allow sending the new style linden "serverside is now viewerside" messages regarding currency This will require all money modules to be refactored! --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 09e751a..c660501 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -651,7 +651,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) { } @@ -875,11 +875,6 @@ namespace OpenSim.Tests.Common.Mock } - public bool AddMoney(int debit) - { - return false; - } - public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) { } -- cgit v1.1 From 51d106cff88334e1b9eb3628f7bdb8d6a18af4f6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 11 Jul 2013 14:21:57 -0700 Subject: Added a test for the asset service --- OpenSim/Tests/Clients/Assets/AssetsClient.cs | 99 ++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 OpenSim/Tests/Clients/Assets/AssetsClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Assets/AssetsClient.cs b/OpenSim/Tests/Clients/Assets/AssetsClient.cs new file mode 100644 index 0000000..dd168a1 --- /dev/null +++ b/OpenSim/Tests/Clients/Assets/AssetsClient.cs @@ -0,0 +1,99 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Text; +using System.Reflection; +using System.Threading; + +using OpenMetaverse; +using log4net; +using log4net.Appender; +using log4net.Layout; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; + +namespace OpenSim.Tests.Clients.AssetsClient +{ + public class AssetsClient + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + private static int m_MaxThreadID = 0; + private static readonly int NREQS = 150; + private static int m_NReceived = 0; + + public static void Main(string[] args) + { + ConsoleAppender consoleAppender = new ConsoleAppender(); + consoleAppender.Layout = + new PatternLayout("[%thread] - %message%newline"); + log4net.Config.BasicConfigurator.Configure(consoleAppender); + + string serverURI = "http://127.0.0.1:8003"; + if (args.Length > 1) + serverURI = args[1]; + int max1, max2; + ThreadPool.GetMaxThreads(out max1, out max2); + m_log.InfoFormat("[ASSET CLIENT]: Connecting to {0} max threads = {1} - {2}", serverURI, max1, max2); + ThreadPool.GetMinThreads(out max1, out max2); + m_log.InfoFormat("[ASSET CLIENT]: Connecting to {0} min threads = {1} - {2}", serverURI, max1, max2); + ThreadPool.SetMinThreads(1, 1); + ThreadPool.SetMaxThreads(10, 3); + ServicePointManager.DefaultConnectionLimit = 12; + + AssetServicesConnector m_Connector = new AssetServicesConnector(serverURI); + m_Connector.MaxAssetRequestConcurrency = 30; + + for (int i = 0; i < NREQS; i++) + { + UUID uuid = UUID.Random(); + m_Connector.Get(uuid.ToString(), null, ResponseReceived); + m_log.InfoFormat("[ASSET CLIENT]: [{0}] requested asset {1}", i, uuid); + } + + Thread.Sleep(20 * 1000); + m_log.InfoFormat("[ASSET CLIENT]: Received responses {0}", m_NReceived); + } + + private static void ResponseReceived(string id, Object sender, AssetBase asset) + { + if (Thread.CurrentThread.ManagedThreadId > m_MaxThreadID) + m_MaxThreadID = Thread.CurrentThread.ManagedThreadId; + int max1, max2; + ThreadPool.GetAvailableThreads(out max1, out max2); + m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3})", id, m_MaxThreadID, max1, max2); + m_NReceived++; + } + } +} -- cgit v1.1 From 83d1680057419229b0708bde59b12159006195cd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 11 Jul 2013 16:43:43 -0700 Subject: Added a few more thingies to the asset client test to poke the threadpool. --- OpenSim/Tests/Clients/Assets/AssetsClient.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Assets/AssetsClient.cs b/OpenSim/Tests/Clients/Assets/AssetsClient.cs index dd168a1..26d740b 100644 --- a/OpenSim/Tests/Clients/Assets/AssetsClient.cs +++ b/OpenSim/Tests/Clients/Assets/AssetsClient.cs @@ -82,7 +82,16 @@ namespace OpenSim.Tests.Clients.AssetsClient m_log.InfoFormat("[ASSET CLIENT]: [{0}] requested asset {1}", i, uuid); } - Thread.Sleep(20 * 1000); + for (int i = 0; i < 500; i++) + { + var x = i; + ThreadPool.QueueUserWorkItem(delegate + { + Dummy(x); + }); + } + + Thread.Sleep(30 * 1000); m_log.InfoFormat("[ASSET CLIENT]: Received responses {0}", m_NReceived); } @@ -92,8 +101,16 @@ namespace OpenSim.Tests.Clients.AssetsClient m_MaxThreadID = Thread.CurrentThread.ManagedThreadId; int max1, max2; ThreadPool.GetAvailableThreads(out max1, out max2); - m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3})", id, m_MaxThreadID, max1, max2); + m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3}) {4}", id, m_MaxThreadID, max1, max2, DateTime.Now.ToString("hh:mm:ss")); m_NReceived++; } + + private static void Dummy(int i) + { + int max1, max2; + ThreadPool.GetAvailableThreads(out max1, out max2); + m_log.InfoFormat("[ASSET CLIENT]: ({0}) Hello! {1} - {2} {3}", i, max1, max2, DateTime.Now.ToString("hh:mm:ss")); + Thread.Sleep(2000); + } } } -- cgit v1.1 From 98f59ffed59d33c3737787bff85a72fde545fc94 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 14 Jul 2013 09:22:55 -0700 Subject: Fix broken tests -- the test setup was wrong... sigh. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c660501..2fc3f0b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -584,7 +584,7 @@ namespace OpenSim.Tests.Common.Mock { AgentCircuitData agentData = new AgentCircuitData(); agentData.AgentID = AgentId; - agentData.SessionID = UUID.Zero; + agentData.SessionID = SessionId; agentData.SecureSessionID = UUID.Zero; agentData.circuitcode = m_circuitCode; agentData.child = false; -- cgit v1.1 From d5a1779465b6d875ebe5822ce6f15df3378b759f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 20 Jul 2013 12:20:35 -0700 Subject: Manage AgentUpdates more sanely: - The existing event to scene has been split into 2: OnAgentUpdate and OnAgentCameraUpdate, to better reflect the two types of updates that the viewer sends. We can run one without the other, which is what happens when the avie is still but the user is camming around - Added thresholds (as opposed to equality) to determine whether the update is significant or not. I thin these thresholds are ok, but we can play with them later - Ignore updates of HeadRotation, which were problematic and aren't being used up stream --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2fc3f0b..5d7349a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -106,6 +106,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; + public event UpdateAgent OnAgentCameraUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; public event AvatarPickerRequest OnAvatarPickerRequest; -- cgit v1.1 From b5ab0698d6328c90d779c2af29914da840335233 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 20 Jul 2013 17:58:32 -0700 Subject: EDIT BEAMS!!! They had been missing from OpenSim since ever. Thanks to lkalif for telling me how to route the information. The viewer effect is under the distance filter, so only avatars with cameras < 10m away see the beams. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 5d7349a..f7220d7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1256,7 +1256,7 @@ namespace OpenSim.Tests.Common.Mock { } - public void StopFlying(ISceneEntity presence) + public void SendAgentTerseUpdate(ISceneEntity presence) { } -- cgit v1.1 From 056a6ee7653b17d8c1d92519f34f029bcd602143 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 19:22:30 +0100 Subject: Fix regression tests relating to agent transfer by making simulator use last week's SIMULATOR/0.1 protocol for now. --- OpenSim/Tests/Common/OpenSimTestCase.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/OpenSimTestCase.cs b/OpenSim/Tests/Common/OpenSimTestCase.cs index 8c40923..3c47faa 100644 --- a/OpenSim/Tests/Common/OpenSimTestCase.cs +++ b/OpenSim/Tests/Common/OpenSimTestCase.cs @@ -27,6 +27,7 @@ using System; using NUnit.Framework; +using OpenSim.Framework.Servers; namespace OpenSim.Tests.Common { @@ -40,7 +41,14 @@ namespace OpenSim.Tests.Common // Disable logging for each test so that one where logging is enabled doesn't cause all subsequent tests // to have logging on if it failed with an exception. TestHelpers.DisableLogging(); + + // This is an unfortunate bit of clean up we have to do because MainServer manages things through static + // variables and the VM is not restarted between tests. + if (MainServer.Instance != null) + { + MainServer.RemoveHttpServer(MainServer.Instance.Port); +// MainServer.Instance = null; + } } } -} - +} \ No newline at end of file -- cgit v1.1 From 7f0d9ad64473ad0defb8d534a8ddadc6d471e4a5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 5 Aug 2013 20:36:46 +0100 Subject: Make test AssetsClient print out more information about any failure to set thread numbers and immediate post config thread numbers --- OpenSim/Tests/Clients/Assets/AssetsClient.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Assets/AssetsClient.cs b/OpenSim/Tests/Clients/Assets/AssetsClient.cs index 26d740b..e988d0e 100644 --- a/OpenSim/Tests/Clients/Assets/AssetsClient.cs +++ b/OpenSim/Tests/Clients/Assets/AssetsClient.cs @@ -68,8 +68,18 @@ namespace OpenSim.Tests.Clients.AssetsClient m_log.InfoFormat("[ASSET CLIENT]: Connecting to {0} max threads = {1} - {2}", serverURI, max1, max2); ThreadPool.GetMinThreads(out max1, out max2); m_log.InfoFormat("[ASSET CLIENT]: Connecting to {0} min threads = {1} - {2}", serverURI, max1, max2); - ThreadPool.SetMinThreads(1, 1); - ThreadPool.SetMaxThreads(10, 3); + + if (!ThreadPool.SetMinThreads(1, 1)) + m_log.WarnFormat("[ASSET CLIENT]: Failed to set min threads"); + + if (!ThreadPool.SetMaxThreads(10, 3)) + m_log.WarnFormat("[ASSET CLIENT]: Failed to set max threads"); + + ThreadPool.GetMaxThreads(out max1, out max2); + m_log.InfoFormat("[ASSET CLIENT]: Post set max threads = {1} - {2}", serverURI, max1, max2); + ThreadPool.GetMinThreads(out max1, out max2); + m_log.InfoFormat("[ASSET CLIENT]: Post set min threads = {1} - {2}", serverURI, max1, max2); + ServicePointManager.DefaultConnectionLimit = 12; AssetServicesConnector m_Connector = new AssetServicesConnector(serverURI); -- cgit v1.1 From b64d3ecaed2c4cc0ffab2e44d02745de4e8f5717 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 12 Aug 2013 18:15:12 +0100 Subject: Create TestSameSimulatorNeighbouringRegionsTeleportV2() regression test for V2 transfer protocol. --- OpenSim/Tests/Common/Mock/TestClient.cs | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f7220d7..9370102 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -61,8 +61,13 @@ namespace OpenSim.Tests.Common.Mock // Test client specific events - for use by tests to implement some IClientAPI behaviour. public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; + public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; public event Action OnReceivedInstantMessage; + public delegate void TestClientOnSendRegionTeleportDelegate( + ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL); + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -472,7 +477,8 @@ namespace OpenSim.Tests.Common.Mock public void CompleteMovement() { - OnCompleteMovementToRegion(this, true); + if (OnCompleteMovementToRegion != null) + OnCompleteMovementToRegion(this, true); } /// @@ -608,21 +614,25 @@ namespace OpenSim.Tests.Common.Mock OnTestClientInformClientOfNeighbour(neighbourHandle, neighbourExternalEndPoint); } - public virtual void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, - uint locationID, uint flags, string capsURL) + public virtual void SendRegionTeleport( + ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL) { - m_log.DebugFormat("[TEST CLIENT]: Received SendRegionTeleport"); + m_log.DebugFormat( + "[TEST CLIENT]: Received SendRegionTeleport for {0} {1} on {2}", m_firstName, m_lastName, m_scene.Name); CapsSeedUrl = capsURL; - // We don't do this here so that the source region can complete processing first in a single-threaded - // regression test scenario. The test itself will have to call CompleteTeleportClientSide() after a teleport - // CompleteTeleportClientSide(); + if (OnTestClientSendRegionTeleport != null) + OnTestClientSendRegionTeleport( + regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); } public virtual void SendTeleportFailed(string reason) { - m_log.DebugFormat("[TEST CLIENT]: Teleport failed with reason {0}", reason); + m_log.DebugFormat( + "[TEST CLIENT]: Teleport failed for {0} {1} on {2} with reason {3}", + m_firstName, m_lastName, m_scene.Name, reason); } public virtual void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, -- cgit v1.1 From f5d3145bea75fe2c84f49685031443c6826ffae7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 17 Aug 2013 00:24:56 +0100 Subject: Add ScenePresenceTeleportTests.TestSameSimulatorIsolatedRegionsV2() regression test for v2 transfers. Also adjusts names of teleport setup helpers in EntityTransferHelpers --- .../Tests/Common/Helpers/EntityTransferHelpers.cs | 43 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index 1b960b1..ff6608d 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -31,6 +31,7 @@ using System.IO; using System.Net; using System.Reflection; using System.Text; +using System.Threading; using log4net; using Nini.Config; using NUnit.Framework; @@ -59,7 +60,8 @@ namespace OpenSim.Tests.Common /// A list that will be populated with any TestClients set up in response to /// being informed about a destination region. /// - public static void SetUpInformClientOfNeighbour(TestClient tc, List neighbourTcs) + public static void SetupInformClientOfNeighbourTriggersNeighbourClientCreate( + TestClient tc, List neighbourTcs) { // XXX: Confusingly, this is also used for non-neighbour notification (as in teleports that do not use the // event queue). @@ -75,8 +77,6 @@ namespace OpenSim.Tests.Common "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}", x, y, neighbourExternalEndPoint); - // In response to this message, we are going to make a teleport to the scene we've previous been told - // about by test code (this needs to be improved). AgentCircuitData newAgent = tc.RequestClientInfo(); Scene neighbourScene; @@ -87,5 +87,42 @@ namespace OpenSim.Tests.Common neighbourScene.AddNewClient(neighbourTc, PresenceType.User); }; } + + /// + /// Set up correct handling of the InformClientOfNeighbour call from the source region that triggers the + /// viewer to setup a connection with the destination region. + /// + /// + /// + /// A list that will be populated with any TestClients set up in response to + /// being informed about a destination region. + /// + public static void SetupSendRegionTeleportTriggersDestinationClientCreateAndCompleteMovement( + TestClient client, List destinationClients) + { + client.OnTestClientSendRegionTeleport + += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) => + { + uint x, y; + Utils.LongToUInts(regionHandle, out x, out y); + x /= Constants.RegionSize; + y /= Constants.RegionSize; + + m_log.DebugFormat( + "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}", + x, y, regionExternalEndPoint); + + AgentCircuitData newAgent = client.RequestClientInfo(); + + Scene destinationScene; + SceneManager.Instance.TryGetScene(x, y, out destinationScene); + + TestClient destinationClient = new TestClient(newAgent, destinationScene); + destinationClients.Add(destinationClient); + destinationScene.AddNewClient(destinationClient, PresenceType.User); + + ThreadPool.UnsafeQueueUserWorkItem(o => destinationClient.CompleteMovement(), null); + }; + } } } \ No newline at end of file -- cgit v1.1 From 2cd95fac736cc99b1a2ad661e4a03810225ffaca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 27 Sep 2013 22:27:39 +0100 Subject: refactor: Rename Scene.AddNewClient() to AddNewAgent() to make it obvious in the code that this is symmetric with CloseAgent() --- OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | 4 ++-- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index ff6608d..52a17e7 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -84,7 +84,7 @@ namespace OpenSim.Tests.Common TestClient neighbourTc = new TestClient(newAgent, neighbourScene); neighbourTcs.Add(neighbourTc); - neighbourScene.AddNewClient(neighbourTc, PresenceType.User); + neighbourScene.AddNewAgent(neighbourTc, PresenceType.User); }; } @@ -119,7 +119,7 @@ namespace OpenSim.Tests.Common TestClient destinationClient = new TestClient(newAgent, destinationScene); destinationClients.Add(destinationClient); - destinationScene.AddNewClient(destinationClient, PresenceType.User); + destinationScene.AddNewAgent(destinationClient, PresenceType.User); ThreadPool.UnsafeQueueUserWorkItem(o => destinationClient.CompleteMovement(), null); }; diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index d9bb85e..4cdfe98 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -548,7 +548,7 @@ namespace OpenSim.Tests.Common Console.WriteLine("NewUserConnection failed: " + reason); // Stage 2: add the new client as a child agent to the scene - scene.AddNewClient(client, PresenceType.User); + scene.AddNewAgent(client, PresenceType.User); return scene.GetScenePresence(client.AgentId); } -- cgit v1.1 From ff5885ab234bc9a7efda49eea0e2200711c4933c Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 1 Nov 2013 11:35:31 -0700 Subject: varregion: push TerrainData implementation up and down the database storage stack. Implement both LoadTerrain and StoreTerrain for all DBs. Move all database blob serialization/deserialization into TerrainData. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 29 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index ed29c39..5df8e04 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -69,11 +69,21 @@ namespace OpenSim.Data.Null m_store.StoreTerrain(terrain, regionID); } + public void StoreTerrain(TerrainData terrain, UUID regionID) + { + m_store.StoreTerrain(terrain, regionID); + } + public double[,] LoadTerrain(UUID regionID) { return m_store.LoadTerrain(regionID); } + public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) + { + return m_store.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); + } + public void StoreLandObject(ILandObject Parcel) { m_store.StoreLandObject(Parcel); @@ -154,7 +164,7 @@ namespace OpenSim.Data.Null protected Dictionary m_sceneObjectParts = new Dictionary(); protected Dictionary> m_primItems = new Dictionary>(); - protected Dictionary m_terrains = new Dictionary(); + protected Dictionary m_terrains = new Dictionary(); protected Dictionary m_landData = new Dictionary(); public void Initialise(string dbfile) @@ -299,12 +309,17 @@ namespace OpenSim.Data.Null return new List(objects.Values); } - public void StoreTerrain(double[,] ter, UUID regionID) + public void StoreTerrain(TerrainData ter, UUID regionID) { m_terrains[regionID] = ter; } - public double[,] LoadTerrain(UUID regionID) + public void StoreTerrain(double[,] ter, UUID regionID) + { + m_terrains[regionID] = new HeightmapTerrainData(ter); + } + + public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) { if (m_terrains.ContainsKey(regionID)) return m_terrains[regionID]; @@ -312,6 +327,14 @@ namespace OpenSim.Data.Null return null; } + public double[,] LoadTerrain(UUID regionID) + { + if (m_terrains.ContainsKey(regionID)) + return m_terrains[regionID].GetDoubles(); + else + return null; + } + public void RemoveLandObject(UUID globalID) { if (m_landData.ContainsKey(globalID)) -- cgit v1.1 From f2810bf03a3e254e0ef8d9bdd639c69cc5cf570c Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 4 Nov 2013 22:10:54 -0800 Subject: varregion: add plumbing to pass region size from Scene down to the physics engine. Older physics engines will default to the legacy region size. Update BulletSim to use the new region size information. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 4cdfe98..008f2d0 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -186,8 +186,9 @@ namespace OpenSim.Tests.Common PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); + Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); testScene.PhysicsScene - = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); + = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); testScene.RegionInfo.EstateSettings = new EstateSettings(); testScene.LoginsEnabled = true; -- cgit v1.1 From beeec1c46726a266edf5c8260f9cf4e4e6f91c8a Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 8 Nov 2013 20:53:37 -0800 Subject: varregion: elimination of Constants.RegionSize from all over OpenSimulator. Routines in Util to compute region world coordinates from region coordinates as well as the conversion to and from region handles. These routines have replaced a lot of math scattered throughout the simulator. Should be no functional changes. --- OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index 52a17e7..049200c 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -69,9 +69,7 @@ namespace OpenSim.Tests.Common tc.OnTestClientInformClientOfNeighbour += (neighbourHandle, neighbourExternalEndPoint) => { uint x, y; - Utils.LongToUInts(neighbourHandle, out x, out y); - x /= Constants.RegionSize; - y /= Constants.RegionSize; + Util.RegionHandleToRegionLoc(neighbourHandle, out x, out y); m_log.DebugFormat( "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}", @@ -104,9 +102,7 @@ namespace OpenSim.Tests.Common += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) => { uint x, y; - Utils.LongToUInts(regionHandle, out x, out y); - x /= Constants.RegionSize; - y /= Constants.RegionSize; + Util.RegionHandleToRegionLoc(regionHandle, out x, out y); m_log.DebugFormat( "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}", -- cgit v1.1 From 5b73b9c4a85335ba837280688b903fef44be8f35 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 11 Dec 2013 01:39:56 +0000 Subject: Committing the Avination Scene Presence and related texture code - Parts of region crossing code - New bakes handling code - Bakes now sent from sim to sim without central storage - Appearance handling changes - Some changes to sitting - A number of unrelated fixes and improvements --- OpenSim/Tests/Performance/NPCPerformanceTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Performance/NPCPerformanceTests.cs b/OpenSim/Tests/Performance/NPCPerformanceTests.cs index 2026a88..eb09061 100644 --- a/OpenSim/Tests/Performance/NPCPerformanceTests.cs +++ b/OpenSim/Tests/Performance/NPCPerformanceTests.cs @@ -144,6 +144,7 @@ namespace OpenSim.Tests.Performance // ScenePresence.SendInitialData() to reset our entire appearance. scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); +/* afm.SetAppearance(sp, originalTe, null); INPCModule npcModule = scene.RequestModuleInterface(); @@ -185,6 +186,7 @@ namespace OpenSim.Tests.Performance endGcMemory / 1024 / 1024, startGcMemory / 1024 / 1024, (endGcMemory - startGcMemory) / 1024 / 1024); +*/ } } -} \ No newline at end of file +} -- cgit v1.1 From a5ca15c42893681a777d091c737d5c7615af4f48 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 18 Dec 2013 23:35:38 +0000 Subject: Create regression test TestSendAgentGroupDataUpdate() for groups agent data sending --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 6707019..e666433 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -38,6 +38,7 @@ using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Framework.Servers; +using OpenSim.Region.ClientStack.Linden; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -164,7 +165,7 @@ namespace OpenSim.Tests.Common throw new System.NotImplementedException (); } - public OSD BuildEvent (string eventName, OSD eventBody) + public OSD BuildEvent(string eventName, OSD eventBody) { Console.WriteLine("TWO"); throw new System.NotImplementedException (); -- cgit v1.1 From 2d2bea4aa75ff6e82384f0842fe3719bf946b1cc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 26 Dec 2013 22:45:59 -0800 Subject: varregion: many more updates removing the constant RegionSize and replacing with a passed region size. This time in the map code and grid services code. --- OpenSim/Tests/Clients/Grid/GridClient.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs index 8e33373..fed7a16 100644 --- a/OpenSim/Tests/Clients/Grid/GridClient.cs +++ b/OpenSim/Tests/Clients/Grid/GridClient.cs @@ -150,16 +150,16 @@ namespace OpenSim.Tests.Clients.GridClient Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)"); regions = m_Connector.GetRegionRange(UUID.Zero, - 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize, - 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize); + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); if (regions == null) Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); else Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 0 regions)"); regions = m_Connector.GetRegionRange(UUID.Zero, - 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize, - 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize); + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950), + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950) ); if (regions == null) Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); else -- cgit v1.1 From 9984ecf862ff7362b0caa6c55554c3fd2243873d Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 3 Jan 2014 07:41:06 -0800 Subject: varregion: Add region size to teleport event messages (EnableSimulator, CorssRegion, TeleportFinishEvent). Have Simian grid service return the region size. Many teleport related debug log messages. Can be removed when teleport works (like that's ever going to happen). --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index e666433..f2bae58 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -114,22 +114,25 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "DisableSimulator", handle); } - public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID) + public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EnableSimulator", handle); } - public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath) + public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath, + ulong regionHandle, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EstablishAgentCommunication", endPoint, capsPath); } - public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, UUID agentID) + public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL, UUID agentID, int regionSizeX, int regionSizeY) { AddEvent(agentID, "TeleportFinishEvent", regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); } - public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL, UUID avatarID, UUID sessionID) + public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, + string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "CrossRegion", handle, pos, lookAt, newRegionExternalEndPoint, capsURL, sessionID); } -- cgit v1.1 From 7e32313a491defe8f5fb62ce0036c1692d4b4af9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 3 Jan 2014 07:41:06 -0800 Subject: varregion: Add region size to teleport event messages (EnableSimulator, CorssRegion, TeleportFinishEvent). Have Simian grid service return the region size. Many teleport related debug log messages. Can be removed when teleport works (like that's ever going to happen). Conflicts: OpenSim/Framework/RegionInfo.cs --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index e666433..f2bae58 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -114,22 +114,25 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "DisableSimulator", handle); } - public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID) + public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EnableSimulator", handle); } - public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath) + public void EstablishAgentCommunication (UUID avatarID, IPEndPoint endPoint, string capsPath, + ulong regionHandle, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EstablishAgentCommunication", endPoint, capsPath); } - public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL, UUID agentID) + public void TeleportFinishEvent (ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, + uint locationID, uint flags, string capsURL, UUID agentID, int regionSizeX, int regionSizeY) { AddEvent(agentID, "TeleportFinishEvent", regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL); } - public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL, UUID avatarID, UUID sessionID) + public void CrossRegion (ulong handle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, + string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "CrossRegion", handle, pos, lookAt, newRegionExternalEndPoint, capsURL, sessionID); } -- cgit v1.1 From 8e72b53edc435c2c2fbec0b8c91304e7f7a6a4f2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 20 Jan 2014 19:16:19 +0000 Subject: Stop exceptions being generated on agent connection if a telehub object has been deleted or has no spawn points. --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 ----- OpenSim/Tests/Common/TestHelpers.cs | 21 +++++++++++++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 9370102..a4247e3 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -788,11 +788,6 @@ namespace OpenSim.Tests.Common.Mock { OnRegionHandShakeReply(this); } - - if (OnCompleteMovementToRegion != null) - { - OnCompleteMovementToRegion(this, true); - } } public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) diff --git a/OpenSim/Tests/Common/TestHelpers.cs b/OpenSim/Tests/Common/TestHelpers.cs index a684d72..6bf23f8 100644 --- a/OpenSim/Tests/Common/TestHelpers.cs +++ b/OpenSim/Tests/Common/TestHelpers.cs @@ -117,8 +117,6 @@ namespace OpenSim.Tests.Common /// Parse a UUID stem into a full UUID. /// /// - /// Yes, this is completely inconsistent with ParseTail but this is probably a better way to do it, - /// UUIDs are conceptually not hexadecmial numbers. /// The fragment will come at the start of the UUID. The rest will be 0s /// /// @@ -143,5 +141,24 @@ namespace OpenSim.Tests.Common { return new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", tail)); } + + /// + /// Parse a UUID tail section into a full UUID. + /// + /// + /// The fragment will come at the end of the UUID. The rest will be 0s + /// + /// + /// + /// A UUID fragment that will be parsed into a full UUID. Therefore, it can only contain + /// cahracters which are valid in a UUID, except for "-" which is currently only allowed if a full UUID is + /// given as the 'fragment'. + /// + public static UUID ParseTail(string stem) + { + string rawUuid = stem.PadLeft(32, '0'); + + return UUID.Parse(rawUuid); + } } } -- cgit v1.1 From fd1b2a1c574a3397383a91279d56cece81945547 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 24 Feb 2014 19:20:50 +0000 Subject: Stop mesh avatars that specify the alpha texture in their bake slots from causing the simulator to continually request that they rebake This is because the alpha texture is not in the cache, we must continue to have the fallback of looking for these and other persisted bakes in the asset service. Relates to http://opensimulator.org/mantis/view.php?id=6927 --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a4247e3..09ff531 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -63,6 +63,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnTestClientInformClientOfNeighbour; public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; public event Action OnReceivedInstantMessage; + public event Action OnReceivedSendRebakeAvatarTextures; public delegate void TestClientOnSendRegionTeleportDelegate( ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, @@ -1227,6 +1228,8 @@ namespace OpenSim.Tests.Common.Mock public void SendRebakeAvatarTextures(UUID textureID) { + if (OnReceivedSendRebakeAvatarTextures != null) + OnReceivedSendRebakeAvatarTextures(textureID); } public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) -- cgit v1.1 From c9415fd76378af35ff76037d46245f2b95e4264f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Mar 2014 00:35:02 +0000 Subject: If an avatar is sitting, send out position updates to clients for any change, not just those outside the usual tolerances. This is to allow small adjustments of less than 0.05m in functions such as llSetPrimitiveLinkParams() to work This is another fix for http://opensimulator.org/mantis/view.php?id=7044 Extends regression test for this case. --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 09ff531..c2b0935 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -62,6 +62,7 @@ namespace OpenSim.Tests.Common.Mock public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; + public event Action OnReceivedEntityUpdate; public event Action OnReceivedInstantMessage; public event Action OnReceivedSendRebakeAvatarTextures; @@ -685,6 +686,8 @@ namespace OpenSim.Tests.Common.Mock public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) { + if (OnReceivedEntityUpdate != null) + OnReceivedEntityUpdate(entity, updateFlags); } public void ReprioritizeUpdates() -- cgit v1.1 From 71918eeab4beee076d53469e8d19addab49135b7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 7 Mar 2014 01:04:40 +0000 Subject: Add regression test for sending group notices via xmlrpc groups connector. --- .../Common/Mock/MockGroupsServicesConnector.cs | 152 +++++++++++++++++---- 1 file changed, 129 insertions(+), 23 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index 3035cea..b3f8c36 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -138,33 +138,28 @@ namespace OpenSim.Tests.Common.Mock { } + private XGroup GetXGroup(UUID groupID, string name) + { + XGroup group = m_data.GetGroup(groupID); + + + if (group == null) + m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: No group found with ID {0}", groupID); + + return group; + } + public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { m_log.DebugFormat( "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", groupID, groupName); - XGroup[] groups; - string field, val; - - if (groupID != UUID.Zero) - { - field = "groupID"; - val = groupID.ToString(); - } - else - { - field = "name"; - val = groupName; - } - - groups = m_data.GetGroups(field, val); + XGroup xg = GetXGroup(groupID, groupName); - if (groups.Length == 0) + if (xg == null) return null; - XGroup xg = groups[0]; - GroupRecord gr = new GroupRecord() { GroupID = xg.groupID, @@ -196,8 +191,25 @@ namespace OpenSim.Tests.Common.Mock { } - public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile) + public void SetAgentGroupInfo(UUID requestingAgentID, UUID agentID, UUID groupID, bool acceptNotices, bool listInProfile) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: SetAgentGroupInfo, requestingAgentID {0}, agentID {1}, groupID {2}, acceptNotices {3}, listInProfile {4}", + requestingAgentID, agentID, groupID, acceptNotices, listInProfile); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return; + + XGroupMember xgm = null; + if (!group.members.TryGetValue(agentID, out xgm)) + return; + + xgm.acceptNotices = acceptNotices; + xgm.listInProfile = listInProfile; + + m_data.StoreGroup(group); } public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID) @@ -213,8 +225,27 @@ namespace OpenSim.Tests.Common.Mock { } - public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + public void AddAgentToGroup(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: AddAgentToGroup, requestingAgentID {0}, agentID {1}, groupID {2}, roleID {3}", + requestingAgentID, agentID, groupID, roleID); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return; + + XGroupMember groupMember = new XGroupMember() + { + agentID = agentID, + groupID = groupID, + roleID = roleID + }; + + group.members[agentID] = groupMember; + + m_data.StoreGroup(group); } public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) @@ -259,9 +290,31 @@ namespace OpenSim.Tests.Common.Mock return null; } - public List GetGroupMembers(UUID requestingAgentID, UUID GroupID) + public List GetGroupMembers(UUID requestingAgentID, UUID groupID) { - return null; + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: GetGroupMembers, requestingAgentID {0}, groupID {1}", + requestingAgentID, groupID); + + List groupMembers = new List(); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return groupMembers; + + foreach (XGroupMember xgm in group.members.Values) + { + GroupMembersData gmd = new GroupMembersData(); + gmd.AgentID = xgm.agentID; + gmd.IsOwner = group.founderID == gmd.AgentID; + gmd.AcceptNotices = xgm.acceptNotices; + gmd.ListInProfile = xgm.listInProfile; + + groupMembers.Add(gmd); + } + + return groupMembers; } public List GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID) @@ -269,18 +322,71 @@ namespace OpenSim.Tests.Common.Mock return null; } - public List GetGroupNotices(UUID requestingAgentID, UUID GroupID) + public List GetGroupNotices(UUID requestingAgentID, UUID groupID) { return null; } public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: GetGroupNotices, requestingAgentID {0}, noticeID {1}", + requestingAgentID, noticeID); + + // Yes, not an efficient way to do it. + Dictionary groups = m_data.GetGroups(); + + foreach (XGroup group in groups.Values) + { + if (group.notices.ContainsKey(noticeID)) + { + XGroupNotice n = group.notices[noticeID]; + + GroupNoticeInfo gni = new GroupNoticeInfo(); + gni.GroupID = n.groupID; + gni.Message = n.message; + gni.BinaryBucket = n.binaryBucket; + gni.noticeData.NoticeID = n.noticeID; + gni.noticeData.Timestamp = n.timestamp; + gni.noticeData.FromName = n.fromName; + gni.noticeData.Subject = n.subject; + gni.noticeData.HasAttachment = n.hasAttachment; + gni.noticeData.AssetType = (byte)n.assetType; + + return gni; + } + } + return null; } public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) { + m_log.DebugFormat( + "[MOCK GROUPS SERVICES CONNECTOR]: AddGroupNotice, requestingAgentID {0}, groupID {1}, noticeID {2}, fromName {3}, subject {4}, message {5}, binaryBucket.Length {6}", + requestingAgentID, groupID, noticeID, fromName, subject, message, binaryBucket.Length); + + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return; + + XGroupNotice groupNotice = new XGroupNotice() + { + groupID = groupID, + noticeID = noticeID, + fromName = fromName, + subject = subject, + message = message, + timestamp = (uint)Util.UnixTimeSinceEpoch(), + hasAttachment = false, + assetType = 0, + binaryBucket = binaryBucket + }; + + group.notices[noticeID] = groupNotice; + + m_data.StoreGroup(group); } public void ResetAgentGroupChatSessions(UUID agentID) -- cgit v1.1 From d975b42f6ae01441e261d51976513de422fae3e3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 11 Mar 2014 23:38:22 +0000 Subject: Instead of auto-creating a parcel on request if one doesn't cover a given location, fill in gaps or extend existing parcel right after initial data load. This is in line with simpler and still existing behaviour where a default parcel is created if no parcels are in storage at all. Making this change as another step to address current problems with spurious parcels occasionally being created. Also adds regression tests for different load behaviours depending on existing stored parcel data. Relates to http://opensimulator.org/mantis/view.php?id=7035 --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 008f2d0..584ca17 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -63,9 +63,9 @@ namespace OpenSim.Tests.Common /// public SceneManager SceneManager { get; private set; } + public ISimulationDataService SimDataService { get; private set; } + private AgentCircuitManager m_acm = new AgentCircuitManager(); - private ISimulationDataService m_simDataService - = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); private IEstateDataService m_estateDataService = null; private LocalAssetServicesConnector m_assetService; @@ -96,6 +96,9 @@ namespace OpenSim.Tests.Common m_presenceService.PostInitialise(); m_cache = cache; + + SimDataService + = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); } /// @@ -139,7 +142,7 @@ namespace OpenSim.Tests.Common SceneCommunicationService scs = new SceneCommunicationService(); TestScene testScene = new TestScene( - regInfo, m_acm, scs, m_simDataService, m_estateDataService, configSource, null); + regInfo, m_acm, scs, SimDataService, m_estateDataService, configSource, null); INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); -- cgit v1.1 From f3e177814a30ee91a2fdd27f2a1aebf06a39cd15 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 17 Mar 2014 20:51:35 +0000 Subject: Add regression test for http inventory fetch. Involved some restructuring to allow regression tests to dequeue inventory requests and perform poll responses synchronously rather than async --- OpenSim/Tests/Common/Mock/TestHttpClientContext.cs | 110 +++++++++++++ OpenSim/Tests/Common/Mock/TestHttpRequest.cs | 174 +++++++++++++++++++++ OpenSim/Tests/Common/Mock/TestHttpResponse.cs | 171 ++++++++++++++++++++ 3 files changed, 455 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestHttpClientContext.cs create mode 100644 OpenSim/Tests/Common/Mock/TestHttpRequest.cs create mode 100644 OpenSim/Tests/Common/Mock/TestHttpResponse.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs new file mode 100644 index 0000000..5a55b09 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs @@ -0,0 +1,110 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Text; +using HttpServer; +using OpenSim.Framework; + +namespace OpenSim.Tests.Common +{ + public class TestHttpClientContext: IHttpClientContext + { + /// + /// Bodies of responses from the server. + /// + public string ResponseBody + { + get { return Encoding.UTF8.GetString(m_responseStream.ToArray()); } + } + + public Byte[] ResponseBodyBytes + { + get{ return m_responseStream.ToArray(); } + } + + private MemoryStream m_responseStream = new MemoryStream(); + + public bool IsSecured { get; set; } + + public bool Secured + { + get { return IsSecured; } + set { IsSecured = value; } + } + + public TestHttpClientContext(bool secured) + { + Secured = secured; + } + + public void Disconnect(SocketError error) + { +// Console.WriteLine("TestHttpClientContext.Disconnect Received disconnect with status {0}", error); + } + + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body) {Console.WriteLine("x");} + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason) {Console.WriteLine("xx");} + public void Respond(string body) { Console.WriteLine("xxx");} + + public void Send(byte[] buffer) + { + // Getting header data here +// Console.WriteLine("xxxx: Got {0}", Encoding.UTF8.GetString(buffer)); + } + + public void Send(byte[] buffer, int offset, int size) + { +// Util.PrintCallStack(); +// +// Console.WriteLine( +// "TestHttpClientContext.Send(byte[], int, int) got offset={0}, size={1}, buffer={2}", +// offset, size, Encoding.UTF8.GetString(buffer)); + + m_responseStream.Write(buffer, offset, size); + } + + public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType) {Console.WriteLine("xxxxxx");} + public void Close() { } + public bool EndWhenDone { get { return false;} set { return;}} + + public HTTPNetworkContext GiveMeTheNetworkStreamIKnowWhatImDoing() + { + return new HTTPNetworkContext(); + } + + public event EventHandler Disconnected = delegate { }; + /// + /// A request have been received in the context. + /// + public event EventHandler RequestReceived = delegate { }; + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs new file mode 100644 index 0000000..b868895 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs @@ -0,0 +1,174 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Specialized; +using System.IO; +using HttpServer; +using HttpServer.FormDecoders; + +namespace OpenSim.Tests.Common +{ + public class TestHttpRequest: IHttpRequest + { + private string _uriPath; + public bool BodyIsComplete + { + get { return true; } + } + public string[] AcceptTypes + { + get {return _acceptTypes; } + } + private string[] _acceptTypes; + public Stream Body + { + get { return _body; } + set { _body = value;} + } + private Stream _body; + public ConnectionType Connection + { + get { return _connection; } + set { _connection = value; } + } + private ConnectionType _connection; + public int ContentLength + { + get { return _contentLength; } + set { _contentLength = value; } + } + private int _contentLength; + public NameValueCollection Headers + { + get { return _headers; } + } + private NameValueCollection _headers = new NameValueCollection(); + + public string HttpVersion { get; set; } + + public string Method + { + get { return _method; } + set { _method = value; } + } + private string _method = null; + public HttpInput QueryString + { + get { return _queryString; } + } + private HttpInput _queryString = null; + public Uri Uri + { + get { return _uri; } + set { _uri = value; } + } + private Uri _uri = null; + public string[] UriParts + { + get { return _uri.Segments; } + } + public HttpParam Param + { + get { return null; } + } + public HttpForm Form + { + get { return null; } + } + public bool IsAjax + { + get { return false; } + } + public RequestCookies Cookies + { + get { return null; } + } + + public TestHttpRequest() + { + HttpVersion = "HTTP/1.1"; + } + + public TestHttpRequest(string contentEncoding, string contentType, string userAgent, + string remoteAddr, string remotePort, string[] acceptTypes, + ConnectionType connectionType, int contentLength, Uri uri) : base() + { + _headers["content-encoding"] = contentEncoding; + _headers["content-type"] = contentType; + _headers["user-agent"] = userAgent; + _headers["remote_addr"] = remoteAddr; + _headers["remote_port"] = remotePort; + + _acceptTypes = acceptTypes; + _connection = connectionType; + _contentLength = contentLength; + _uri = uri; + } + + public void DecodeBody(FormDecoderProvider providers) {} + public void SetCookies(RequestCookies cookies) {} + public void AddHeader(string name, string value) + { + _headers.Add(name, value); + } + public int AddToBody(byte[] bytes, int offset, int length) + { + return 0; + } + public void Clear() {} + + public object Clone() + { + TestHttpRequest clone = new TestHttpRequest(); + clone._acceptTypes = _acceptTypes; + clone._connection = _connection; + clone._contentLength = _contentLength; + clone._uri = _uri; + clone._headers = new NameValueCollection(_headers); + + return clone; + } + public IHttpResponse CreateResponse(IHttpClientContext context) + { + return new HttpResponse(context, this); + } + /// + /// Path and query (will be merged with the host header) and put in Uri + /// + /// + public string UriPath + { + get { return _uriPath; } + set + { + _uriPath = value; + + } + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs new file mode 100644 index 0000000..ff47c10 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs @@ -0,0 +1,171 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.IO; +using System.Net; +using System.Text; +using HttpServer; + +namespace OpenSim.Tests.Common +{ + public class TestHttpResponse: IHttpResponse + { + public Stream Body + { + get { return _body; } + + set { _body = value; } + } + private Stream _body; + + public string ProtocolVersion + { + get { return _protocolVersion; } + set { _protocolVersion = value; } + } + private string _protocolVersion; + + public bool Chunked + { + get { return _chunked; } + + set { _chunked = value; } + } + private bool _chunked; + + public ConnectionType Connection + { + get { return _connection; } + + set { _connection = value; } + } + private ConnectionType _connection; + + public Encoding Encoding + { + get { return _encoding; } + + set { _encoding = value; } + } + private Encoding _encoding; + + public int KeepAlive + { + get { return _keepAlive; } + + set { _keepAlive = value; } + } + private int _keepAlive; + + public HttpStatusCode Status + { + get { return _status; } + + set { _status = value; } + } + private HttpStatusCode _status; + + public string Reason + { + get { return _reason; } + + set { _reason = value; } + } + private string _reason; + + public long ContentLength + { + get { return _contentLength; } + + set { _contentLength = value; } + } + private long _contentLength; + + public string ContentType + { + get { return _contentType; } + + set { _contentType = value; } + } + private string _contentType; + + public bool HeadersSent + { + get { return _headersSent; } + } + private bool _headersSent; + + public bool Sent + { + get { return _sent; } + } + private bool _sent; + + public ResponseCookies Cookies + { + get { return _cookies; } + } + private ResponseCookies _cookies = null; + + public TestHttpResponse() + { + _headersSent = false; + _sent = false; + } + + public void AddHeader(string name, string value) {} + + public void Send() + { + if (!_headersSent) SendHeaders(); + if (_sent) throw new InvalidOperationException("stuff already sent"); + _sent = true; + } + + public void SendBody(byte[] buffer, int offset, int count) + { + if (!_headersSent) SendHeaders(); + _sent = true; + } + + public void SendBody(byte[] buffer) + { + if (!_headersSent) SendHeaders(); + _sent = true; + } + + public void SendHeaders() + { + if (_headersSent) throw new InvalidOperationException("headers already sent"); + _headersSent = true; + } + + public void Redirect(Uri uri) {} + public void Redirect(string url) {} + } +} \ No newline at end of file -- cgit v1.1 From 0af8886400e56cfbc2efc0d6a8ab01eb289b4e52 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 2 Apr 2014 00:58:33 +0100 Subject: Fix problem where moving an object to another region on the same simulator was failing, with the object returning to its original position. Root cause was that PrimLimitsModule was not properly handling the case where the parcel it was asked to check was outside the current region's bounds. If this is the case, we can abort the check since the receiving region will perform it. Added a regression test for this case. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 584ca17..345ca8a 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -595,6 +595,32 @@ namespace OpenSim.Tests.Common return so; } + + /// + /// Add a test object + /// + /// + /// + /// The number of parts that should be in the scene object + /// + /// + /// + /// The prefix to be given to part names. This will be suffixed with "Part" + /// (e.g. mynamePart1 for the root part) + /// + /// + /// The hexadecimal last part of the UUID for parts created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}" + /// will be given to the root part, and incremented for each part thereafter. + /// + /// + public static SceneObjectGroup AddSceneObject(Scene scene, int parts, UUID ownerId, string partNamePrefix, int uuidTail) + { + SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail); + + scene.AddNewSceneObject(so, false); + + return so; + } /// /// Create a scene object part. -- cgit v1.1 From d1c3f8eef58b29eb8760eeb1ac03852a2387f927 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 31 Mar 2014 11:53:12 +0300 Subject: Added assets service method AssetsExist(), which returns whether the given list of assets exist. This method is used to optimize sending assets with embedded assets: e.g., when a Hypergrid visitor takes an item into the inventory. --- OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index cfefd38..e6e08cd 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; @@ -37,7 +38,7 @@ namespace OpenSim.Tests.Common.Mock public AssetBase FetchAsset(UUID uuid) { - if (ExistsAsset(uuid)) + if (AssetsExist(new[] { uuid })[0]) return Assets[uuid]; else return null; @@ -53,9 +54,9 @@ namespace OpenSim.Tests.Common.Mock CreateAsset(asset); } - public bool ExistsAsset(UUID uuid) - { - return Assets.ContainsKey(uuid); + public bool[] AssetsExist(UUID[] uuids) + { + return Array.ConvertAll(uuids, id => Assets.ContainsKey(id)); } } } \ No newline at end of file -- cgit v1.1 From 06e0528d0b9929cbd8d2b360b0baa00288340d13 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 9 Apr 2014 08:03:25 +0300 Subject: In teleports, pass the source region to the destination (similar to an HTTP referrer) --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 345ca8a..8f44555 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -548,7 +548,7 @@ namespace OpenSim.Tests.Common string reason; // Stage 1: tell the scene to expect a new user connection - if (!scene.NewUserConnection(agentData, (uint)tf, out reason)) + if (!scene.NewUserConnection(agentData, (uint)tf, null, out reason)) Console.WriteLine("NewUserConnection failed: " + reason); // Stage 2: add the new client as a child agent to the scene -- cgit v1.1 From 530c86335d637ed72411c1161c89ece166160586 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 11 Apr 2014 00:20:05 +0100 Subject: Fix the presence info caching used in llRequestAgentData(), which was completely inoperative. This means the presence info may be out of date by up to 20 seconds, but this avoids scripts potentially triggering constants requests to user accout and presence info services. Relates to http://opensimulator.org/mantis/view.php?id=7088 though I fixed in a different way. Adds regression test for this case. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 8f44555..eb8078d 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -30,6 +30,7 @@ using System.Net; using System.Collections.Generic; using Nini.Config; using OpenMetaverse; +using OpenSim.Data.Null; using OpenSim.Framework; using OpenSim.Framework.Communications; using OpenSim.Framework.Console; @@ -301,6 +302,11 @@ namespace OpenSim.Tests.Common /// private static LocalPresenceServicesConnector StartPresenceService() { + // Unfortunately, some services share data via statics, so we need to null every time to stop interference + // between tests. + // This is a massive non-obvious pita. + NullPresenceData.Instance = null; + IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("PresenceService"); -- cgit v1.1 From 998d7009a65def0a4debc9369d35b63611db5b55 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 22 Apr 2014 20:04:12 +0300 Subject: Eliminated many warnings --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index b444241..57be1da 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -94,8 +94,10 @@ namespace OpenSim.Tests.Common public Type ReplaceableInterface { get { return null; } } +#pragma warning disable 0067 public event ScriptRemoved OnScriptRemoved; public event ObjectRemoved OnObjectRemoved; +#pragma warning restore 0067 public string GetXMLState (UUID itemID) { @@ -263,4 +265,4 @@ namespace OpenSim.Tests.Common PostedEvents.Clear(); } } -} \ No newline at end of file +} -- cgit v1.1 From 9664273df6d74e33aacaf1d4a38a287e218009d4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Apr 2014 23:34:30 +0100 Subject: Add basic regression test for creating a var region --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index eb8078d..874ff62 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -119,6 +119,11 @@ namespace OpenSim.Tests.Common return SetupScene(name, id, x, y, new IniConfigSource()); } + public TestScene SetupScene(string name, UUID id, uint x, uint y, IConfigSource configSource) + { + return SetupScene(name, id, x, y, Constants.RegionSize, Constants.RegionSize, configSource); + } + /// /// Set up a scene. /// @@ -126,10 +131,12 @@ namespace OpenSim.Tests.Common /// ID of the region /// X co-ordinate of the region /// Y co-ordinate of the region + /// X size of scene + /// Y size of scene /// /// public TestScene SetupScene( - string name, UUID id, uint x, uint y, IConfigSource configSource) + string name, UUID id, uint x, uint y, uint sizeX, uint sizeY, IConfigSource configSource) { Console.WriteLine("Setting up test scene {0}", name); @@ -139,6 +146,8 @@ namespace OpenSim.Tests.Common RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); regInfo.RegionName = name; regInfo.RegionID = id; + regInfo.RegionSizeX = sizeX; + regInfo.RegionSizeY = sizeY; SceneCommunicationService scs = new SceneCommunicationService(); -- cgit v1.1 From 3a6f3124841ee91778df1d7fa2fbda9893079c6d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 19 May 2014 22:06:41 +0100 Subject: Fix recent regression from 77e7bbc where an attachment on a received group notice with XmlRpcGroups messaging did not appear in the user's inventory. This was because the "session ID" when the message template was copied was always replaced with the group ID, whereas a notice requires this to be the notice ID. Instead just copy the "session ID" as is - other callers already have this set properly so replacing with group ID was redundant anyway. Relates to http://opensimulator.org/mantis/view.php?id=7037 --- .../Common/Mock/MockGroupsServicesConnector.cs | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index b3f8c36..5a257e9 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -324,7 +324,29 @@ namespace OpenSim.Tests.Common.Mock public List GetGroupNotices(UUID requestingAgentID, UUID groupID) { - return null; + XGroup group = GetXGroup(groupID, null); + + if (group == null) + return null; + + List notices = new List(); + + foreach (XGroupNotice notice in group.notices.Values) + { + GroupNoticeData gnd = new GroupNoticeData() + { + NoticeID = notice.noticeID, + Timestamp = notice.timestamp, + FromName = notice.fromName, + Subject = notice.subject, + HasAttachment = notice.hasAttachment, + AssetType = (byte)notice.assetType + }; + + notices.Add(gnd); + } + + return notices; } public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) -- cgit v1.1 From 1b156b7fe84bf132b51ff198d6d730708f5930b7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 May 2014 19:18:24 +0100 Subject: Add regression test for in-range chat between neighbouring regions from east to west. --- OpenSim/Tests/Common/Mock/TestClient.cs | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c2b0935..8eeaf99 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -62,14 +62,23 @@ namespace OpenSim.Tests.Common.Mock public event Action OnReceivedMoveAgentIntoRegion; public event Action OnTestClientInformClientOfNeighbour; public event TestClientOnSendRegionTeleportDelegate OnTestClientSendRegionTeleport; + public event Action OnReceivedEntityUpdate; + + public event OnReceivedChatMessageDelegate OnReceivedChatMessage; public event Action OnReceivedInstantMessage; + public event Action OnReceivedSendRebakeAvatarTextures; public delegate void TestClientOnSendRegionTeleportDelegate( ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL); + public delegate void OnReceivedChatMessageDelegate( + string message, byte type, Vector3 fromPos, string fromName, + UUID fromAgentID, UUID ownerID, byte source, byte audible); + + // disable warning: public events, part of the public API #pragma warning disable 67 @@ -467,6 +476,34 @@ namespace OpenSim.Tests.Common.Mock } /// + /// Trigger chat coming from this connection. + /// + /// + /// + /// + public bool Chat(int channel, ChatTypeEnum type, string message) + { + ChatMessage handlerChatFromClient = OnChatFromClient; + + if (handlerChatFromClient != null) + { + OSChatMessage args = new OSChatMessage(); + args.Channel = channel; + args.From = Name; + args.Message = message; + args.Type = type; + + args.Scene = Scene; + args.Sender = this; + args.SenderUUID = AgentId; + + handlerChatFromClient(this, args); + } + + return true; + } + + /// /// Attempt a teleport to the given region. /// /// @@ -550,6 +587,9 @@ namespace OpenSim.Tests.Common.Mock string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source, byte audible) { +// Console.WriteLine("mmm {0} {1} {2}", message, Name, AgentId); + if (OnReceivedChatMessage != null) + OnReceivedChatMessage(message, type, fromPos, fromName, fromAgentID, ownerID, source, audible); } public void SendInstantMessage(GridInstantMessage im) -- cgit v1.1 From 65a135f4d33fc0be3738f11c51a6c27c344a10aa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 May 2014 19:47:33 +0100 Subject: Simplify regression TestInterRegionChatDistanceEastWest() by making the child presence connection directly rather than routing through TestClient. This code isn't relevant to this test and is already exercised by other tests. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 874ff62..342cd06 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -574,7 +574,11 @@ namespace OpenSim.Tests.Common public static ScenePresence AddChildScenePresence(Scene scene, UUID agentId) { - AgentCircuitData acd = GenerateAgentData(agentId); + return AddChildScenePresence(scene, GenerateAgentData(agentId)); + } + + public static ScenePresence AddChildScenePresence(Scene scene, AgentCircuitData acd) + { acd.child = true; // XXX: ViaLogin may not be correct for child agents -- cgit v1.1 From 0eede1467f4807de3ad84673ba524f1e99de6b72 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 30 May 2014 13:11:46 -0700 Subject: Moved these two estate-related interfaces to the projects where they belong. --- OpenSim/Tests/Common/Mock/TestScene.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index a7e0dfb..2773624 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -33,6 +33,7 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; namespace OpenSim.Tests.Common.Mock { -- cgit v1.1 From 889194db63016ad4b9ecb0c6ae82d3d9c7632c95 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 2 Jul 2014 23:48:44 +0100 Subject: Actually call Close() for shared region modules when the simulator is being shutdown. Adds regression test for this case. --- OpenSim/Tests/Common/OpenSimTestCase.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/OpenSimTestCase.cs b/OpenSim/Tests/Common/OpenSimTestCase.cs index 3c47faa..c1415af 100644 --- a/OpenSim/Tests/Common/OpenSimTestCase.cs +++ b/OpenSim/Tests/Common/OpenSimTestCase.cs @@ -27,6 +27,7 @@ using System; using NUnit.Framework; +using OpenSim.Framework; using OpenSim.Framework.Servers; namespace OpenSim.Tests.Common -- cgit v1.1 From 3654ae8d8cea0bf0455974efe18ff99e484d2893 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 29 Jul 2014 01:21:15 +0100 Subject: Allow the "debug scene set physics false|true" command to work when bulletsim physics is running in a separate thread. This will also allow the "disable physics" setting in the region debug viewer dialog to work in this circumstance. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 17 +++++++++-------- OpenSim/Tests/Common/Mock/TestScene.cs | 5 +++-- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 342cd06..ae2be70 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -151,8 +151,15 @@ namespace OpenSim.Tests.Common SceneCommunicationService scs = new SceneCommunicationService(); + PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); + physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); + Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); + PhysicsScene physicsScene + = physicsPluginManager.GetPhysicsScene( + "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); + TestScene testScene = new TestScene( - regInfo, m_acm, scs, SimDataService, m_estateDataService, configSource, null); + regInfo, m_acm, physicsScene, scs, SimDataService, m_estateDataService, configSource, null); INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); @@ -195,13 +202,7 @@ namespace OpenSim.Tests.Common testScene.SetModuleInterfaces(); testScene.LandChannel = new TestLandChannel(testScene); - testScene.LoadWorldMap(); - - PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); - physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); - Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); - testScene.PhysicsScene - = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); + testScene.LoadWorldMap(); testScene.RegionInfo.EstateSettings = new EstateSettings(); testScene.LoginsEnabled = true; diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 2773624..40e2adc 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -33,6 +33,7 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Physics.Manager; using OpenSim.Services.Interfaces; namespace OpenSim.Tests.Common.Mock @@ -40,10 +41,10 @@ namespace OpenSim.Tests.Common.Mock public class TestScene : Scene { public TestScene( - RegionInfo regInfo, AgentCircuitManager authen, + RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, sceneGridService, simDataService, estateDataService, + : base(regInfo, authen, physicsScene, sceneGridService, simDataService, estateDataService, config, simulatorVersion) { } -- cgit v1.1 From a5e9429f2bb2276486cc2f1ed2249e14fba90d6a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 31 Jul 2014 03:10:50 +0100 Subject: MESS: changes in MakeRootAgent and CompleteMovement reordering things. Added sending of land overlay and parcel information. This in order to only send avatar related information after having its position well defined and on the right parcel. THIS MAY STILL BE BAD :) --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 3115035..8135bfc 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -111,5 +111,6 @@ namespace OpenSim.Tests.Common.Mock public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} + public void sendClientInitialLandInfo(IClientAPI remoteClient) { } } } \ No newline at end of file -- cgit v1.1 From 8c657e48377213e7ee66c05a4047085cee6084ea Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 14 Aug 2014 20:41:36 +0100 Subject: add a estimator of client ping time, and painfully make it visible in show connections console command --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 52e0134..f3eaed3 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -379,6 +379,8 @@ namespace OpenSim.Tests.Common.Mock get { return FirstName + " " + LastName; } } + public int PingTimeMS { get { return 0; } } + public bool IsActive { get { return true; } -- cgit v1.1 From 5bf145a3977a55c474106bbe2a6c107dd9457f0d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 21 Aug 2014 00:49:10 +0100 Subject: add a direct sendpartfullUpdate to send a full object update to a part, optionally overriding its parentID. check what it does to attachments --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f3eaed3..2758030 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -536,6 +536,10 @@ namespace OpenSim.Tests.Common.Mock ReceivedKills.AddRange(localID); } + public void SendPartFullUpdate(ISceneEntity ent, uint? parentID) + { + } + public virtual void SetChildAgentThrottle(byte[] throttle) { } -- cgit v1.1 From 7351d92a76ac24edce848fe7410e920f17962101 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 29 Aug 2014 16:19:30 +0100 Subject: add method to get a category throttle rate --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2758030..00929df 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -548,6 +548,11 @@ namespace OpenSim.Tests.Common.Mock { } + public int GetAgentThrottleSilent(int throttle) + { + return 0; + } + public byte[] GetThrottlesPacked(float multiplier) { return new byte[0]; -- cgit v1.1 From 2a9528fa225214557dac59fb9259086c5d99fbb6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Sep 2014 23:16:01 +0100 Subject: Don't unnecessarily remove from backup objects that were not directly attached from the scene. These are never in region backup in the first place since recent 11830c43 Extend regression test to check backup status. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index ae2be70..4369659 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -611,7 +611,7 @@ namespace OpenSim.Tests.Common //part.UpdatePrimFlags(false, false, true); //part.ObjectFlags |= (uint)PrimFlags.Phantom; - scene.AddNewSceneObject(so, false); + scene.AddNewSceneObject(so, true); return so; } -- cgit v1.1 From caddabb5c4f62767305a589e9d818ae3457a8030 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 6 Nov 2014 22:25:16 +0000 Subject: scale ChildAgentThrottles with distance (internal to child server and not root as was done before ) --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 00929df..d4f29c8 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -544,6 +544,10 @@ namespace OpenSim.Tests.Common.Mock { } + public virtual void SetChildAgentThrottle(byte[] throttle, float factor) + { + } + public void SetAgentThrottleSilent(int throttle, int setting) { } -- cgit v1.1 From 52370ac94de4f449645eb0471fab4cc515fccbe2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 8 Oct 2014 20:17:51 +0100 Subject: refactor: Move test clientstack setup code out of BasicCircuitTests into OpenSim.Tests.Common.ClientStackHelpers --- OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs | 95 ++++++++++++ OpenSim/Tests/Common/Mock/TestLLUDPServer.cs | 171 +++++++++++++++++++++ 2 files changed, 266 insertions(+) create mode 100644 OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs create mode 100644 OpenSim/Tests/Common/Mock/TestLLUDPServer.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs new file mode 100644 index 0000000..33cd8a2 --- /dev/null +++ b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs @@ -0,0 +1,95 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Net; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.ClientStack.LindenUDP; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Tests.Common +{ + /// + /// This class adds full UDP client classes and associated scene presence to scene. + /// + /// + /// This is used for testing client stack code. For testing other code, use SceneHelper methods instead since + /// they operate without the burden of setting up UDP structures which should be unnecessary for testing scene + /// code. + /// + public static class ClientStackHelpers + { + public static ScenePresence AddChildClient( + Scene scene, LLUDPServer udpServer, UUID agentId, UUID sessionId, uint circuitCode) + { + IPEndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); + + UseCircuitCodePacket uccp = new UseCircuitCodePacket(); + + UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock + = new UseCircuitCodePacket.CircuitCodeBlock(); + uccpCcBlock.Code = circuitCode; + uccpCcBlock.ID = agentId; + uccpCcBlock.SessionID = sessionId; + uccp.CircuitCode = uccpCcBlock; + + byte[] uccpBytes = uccp.ToBytes(); + UDPPacketBuffer upb = new UDPPacketBuffer(testEp, uccpBytes.Length); + upb.DataLength = uccpBytes.Length; // God knows why this isn't set by the constructor. + Buffer.BlockCopy(uccpBytes, 0, upb.Data, 0, uccpBytes.Length); + + AgentCircuitData acd = new AgentCircuitData(); + acd.AgentID = agentId; + acd.SessionID = sessionId; + + scene.AuthenticateHandler.AddNewCircuit(circuitCode, acd); + + udpServer.PacketReceived(upb); + + return scene.GetScenePresence(agentId); + } + + public static TestLLUDPServer AddUdpServer(Scene scene) + { + return AddUdpServer(scene, new IniConfigSource()); + } + + public static TestLLUDPServer AddUdpServer(Scene scene, IniConfigSource configSource) + { + uint port = 0; + AgentCircuitManager acm = scene.AuthenticateHandler; + + TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, false, configSource, acm); + udpServer.AddScene(scene); + + return udpServer; + } + } +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs new file mode 100644 index 0000000..26887c9 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs @@ -0,0 +1,171 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using Nini.Config; +using OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.ClientStack.LindenUDP; + +namespace OpenSim.Tests.Common +{ + /// + /// This class enables regression testing of the LLUDPServer by allowing us to intercept outgoing data. + /// + public class TestLLUDPServer : LLUDPServer + { + public List PacketsSent { get; private set; } + + public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) + : base(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager) + { + PacketsSent = new List(); + } + + public override void SendAckImmediate(IPEndPoint remoteEndpoint, PacketAckPacket ack) + { + PacketsSent.Add(ack); + } + + public override void SendPacket( + LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting, UnackedPacketMethod method) + { + PacketsSent.Add(packet); + } + + public void ClientOutgoingPacketHandler(IClientAPI client, bool resendUnacked, bool sendAcks, bool sendPing) + { + m_resendUnacked = resendUnacked; + m_sendAcks = sendAcks; + m_sendPing = sendPing; + + ClientOutgoingPacketHandler(client); + } + +//// /// +//// /// The chunks of data to pass to the LLUDPServer when it calls EndReceive +//// /// +//// protected Queue m_chunksToLoad = new Queue(); +// +//// protected override void BeginReceive() +//// { +//// if (m_chunksToLoad.Count > 0 && m_chunksToLoad.Peek().BeginReceiveException) +//// { +//// ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); +//// reusedEpSender = tuple.Sender; +//// throw new SocketException(); +//// } +//// } +// +//// protected override bool EndReceive(out int numBytes, IAsyncResult result, ref EndPoint epSender) +//// { +//// numBytes = 0; +//// +//// //m_log.Debug("Queue size " + m_chunksToLoad.Count); +//// +//// if (m_chunksToLoad.Count <= 0) +//// return false; +//// +//// ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); +//// RecvBuffer = tuple.Data; +//// numBytes = tuple.Data.Length; +//// epSender = tuple.Sender; +//// +//// return true; +//// } +// +//// public override void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) +//// { +//// // Don't do anything just yet +//// } +// +// /// +// /// Signal that this chunk should throw an exception on Socket.BeginReceive() +// /// +// /// +// public void LoadReceiveWithBeginException(EndPoint epSender) +// { +// ChunkSenderTuple tuple = new ChunkSenderTuple(epSender); +// tuple.BeginReceiveException = true; +// m_chunksToLoad.Enqueue(tuple); +// } +// +// /// +// /// Load some data to be received by the LLUDPServer on the next receive call +// /// +// /// +// /// +// public void LoadReceive(byte[] data, EndPoint epSender) +// { +// m_chunksToLoad.Enqueue(new ChunkSenderTuple(data, epSender)); +// } +// +// /// +// /// Load a packet to be received by the LLUDPServer on the next receive call +// /// +// /// +// public void LoadReceive(Packet packet, EndPoint epSender) +// { +// LoadReceive(packet.ToBytes(), epSender); +// } +// +// /// +// /// Calls the protected asynchronous result method. This fires out all data chunks currently queued for send +// /// +// /// +// public void ReceiveData(IAsyncResult result) +// { +// // Doesn't work the same way anymore +//// while (m_chunksToLoad.Count > 0) +//// OnReceivedData(result); +// } + } + + /// + /// Record the data and sender tuple + /// + public class ChunkSenderTuple + { + public byte[] Data; + public EndPoint Sender; + public bool BeginReceiveException; + + public ChunkSenderTuple(byte[] data, EndPoint sender) + { + Data = data; + Sender = sender; + } + + public ChunkSenderTuple(EndPoint sender) + { + Sender = sender; + } + } +} -- cgit v1.1 From fc878a33edcb403018e485ba0e8b7a6b3a8c3a16 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 8 Oct 2014 21:09:25 +0100 Subject: refactor: consistently put all test classes in the OpenSim.Tests.Common package rather than some in OpenSim.Tests.Common.Mock the separate mock package was not useful and was just another using line to always add --- OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs | 1 - OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | 1 - OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 1 - OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 2 +- OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | 2 +- OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs | 2 +- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs | 2 +- OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs | 2 +- OpenSim/Tests/Performance/NPCPerformanceTests.cs | 1 - OpenSim/Tests/Performance/ObjectPerformanceTests.cs | 1 - OpenSim/Tests/Performance/ScriptPerformanceTests.cs | 1 - OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs | 1 - 17 files changed, 10 insertions(+), 17 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs index 49c99c5..82ecf9a 100644 --- a/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs @@ -32,7 +32,6 @@ using NUnit.Framework; using OpenSim.Framework; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Tests.Common.Mock; namespace OpenSim.Tests.Common { diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index 049200c..cf7583e 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -43,7 +43,6 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.CoreModules.Framework; using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; namespace OpenSim.Tests.Common { diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 4369659..1fb1c5c 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -49,7 +49,6 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence; using OpenSim.Services.Interfaces; -using OpenSim.Tests.Common.Mock; using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Tests.Common diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index e6e08cd..cb4fb80 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -30,7 +30,7 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class BaseAssetRepository { diff --git a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs index 4a15cf2..dddf75d 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs @@ -31,7 +31,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { /// /// In memory asset data plugin for test purposes. Could be another dll when properly filled out and when the diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index 5a257e9..7f530d0 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -40,7 +40,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 8eeaf99..0e1bc8f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -38,7 +38,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Framework.Client; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestClient : IClientAPI, IClientCore { diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index fc44358..a8883b8 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -33,7 +33,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Data; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { /// /// In memory inventory data plugin for test purposes. Could be another dll when properly filled out and when the diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 3115035..89ebcd5 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -32,7 +32,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.CoreModules.World.Land; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { /// /// Land channel for test purposes diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs index e769d30..7b1d2b5 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpRequest.cs @@ -35,7 +35,7 @@ using System.Text; using System.Web; using OpenSim.Framework.Servers.HttpServer; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestOSHttpRequest : IOSHttpRequest { diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index e10fe82..2e17f1e 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -32,7 +32,7 @@ using System.Text; using System.Web; using OpenSim.Framework.Servers.HttpServer; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestOSHttpResponse : IOSHttpResponse { diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 40e2adc..45acf91 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -36,7 +36,7 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; using OpenSim.Services.Interfaces; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestScene : Scene { diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index 2be5524..be3a0cb 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -35,7 +35,7 @@ using OpenSim.Framework; using OpenSim.Data; using OpenSim.Data.Null; -namespace OpenSim.Tests.Common.Mock +namespace OpenSim.Tests.Common { public class TestXInventoryDataPlugin : NullGenericDataHandler, IXInventoryData { diff --git a/OpenSim/Tests/Performance/NPCPerformanceTests.cs b/OpenSim/Tests/Performance/NPCPerformanceTests.cs index eb09061..e222dc2 100644 --- a/OpenSim/Tests/Performance/NPCPerformanceTests.cs +++ b/OpenSim/Tests/Performance/NPCPerformanceTests.cs @@ -45,7 +45,6 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Region.OptionalModules.World.NPC; using OpenSim.Services.AvatarService; using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; namespace OpenSim.Tests.Performance { diff --git a/OpenSim/Tests/Performance/ObjectPerformanceTests.cs b/OpenSim/Tests/Performance/ObjectPerformanceTests.cs index 656a971..9dad423 100644 --- a/OpenSim/Tests/Performance/ObjectPerformanceTests.cs +++ b/OpenSim/Tests/Performance/ObjectPerformanceTests.cs @@ -34,7 +34,6 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; namespace OpenSim.Tests.Performance { diff --git a/OpenSim/Tests/Performance/ScriptPerformanceTests.cs b/OpenSim/Tests/Performance/ScriptPerformanceTests.cs index 4064edc..028f4b0 100644 --- a/OpenSim/Tests/Performance/ScriptPerformanceTests.cs +++ b/OpenSim/Tests/Performance/ScriptPerformanceTests.cs @@ -40,7 +40,6 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.ScriptEngine.XEngine; using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; namespace OpenSim.Tests.Performance { diff --git a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs index 1f220c0..9b3cc93 100644 --- a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs +++ b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs @@ -41,7 +41,6 @@ using OpenSim.Region.CoreModules.Scripting.VectorRender; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; namespace OpenSim.Tests.Stress { -- cgit v1.1 From ec8d21c434a39f46518ee9cf9f5539d1790eacc0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 4 Nov 2014 00:55:48 +0000 Subject: Label all threadpool calls being made in core OpenSimulator. This is to add problem diagnosis. "show threadpool calls" now also returns named (labelled), anonymous (unlabelled) and total call stats. --- OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs index 9b3cc93..0ab407e 100644 --- a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs +++ b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs @@ -78,7 +78,7 @@ namespace OpenSim.Tests.Stress Drawer d = new Drawer(this, i); drawers.Add(d); Console.WriteLine("Starting drawer {0}", i); - Util.FireAndForget(o => d.Draw()); + Util.FireAndForget(o => d.Draw(), null, "VectorRenderModuleStressTests.TestConcurrentRepeatedDraw"); } Thread.Sleep(10 * 60 * 1000); -- cgit v1.1 From 8d724e90de0fb3b406f82f4e06b6f5b79c5a538c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Jan 2015 22:44:54 +0000 Subject: For scripts in attachments, don't save .state files apart from the initial one as these are ignored since .state is saved in the attachment's asset. This eliminates pointless work and exceptions when an appdomain is unloaded whilst an attachment script state is persisted. Adds test for this case. Relates to http://opensimulator.org/mantis/view.php?id=7407 --- .../Tests/Common/Helpers/TaskInventoryHelpers.cs | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index bb4b55f..b4bd50b 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -117,25 +117,43 @@ namespace OpenSim.Tests.Common public static TaskInventoryItem AddScript( Scene scene, SceneObjectPart part, string scriptName, string scriptSource) { + return AddScript(scene, part, UUID.Random(), UUID.Random(), scriptName, scriptSource); + } + + /// + /// Add a simple script to the given part. + /// + /// + /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather + /// than a random component. + /// + /// + /// + /// Item UUID for the script + /// Asset UUID for the script + /// Name of the script to add + /// LSL script source + /// The item that was added + public static TaskInventoryItem AddScript( + Scene scene, SceneObjectPart part, UUID itemId, UUID assetId, string scriptName, string scriptSource) + { AssetScriptText ast = new AssetScriptText(); ast.Source = scriptSource; ast.Encode(); - UUID assetUuid = UUID.Random(); - UUID itemUuid = UUID.Random(); - AssetBase asset - = AssetHelpers.CreateAsset(assetUuid, AssetType.LSLText, ast.AssetData, UUID.Zero); + = AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero); scene.AssetService.Store(asset); TaskInventoryItem item = new TaskInventoryItem - { Name = scriptName, AssetID = assetUuid, ItemID = itemUuid, - Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL }; + { Name = scriptName, AssetID = assetId, ItemID = itemId, + Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL }; part.Inventory.AddInventoryItem(item, true); - + return item; } + /// /// Add a scene object item to the given part. /// -- cgit v1.1 From 1d2616e7a24882b197de0db3d76c1e02a7cfcd90 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 3 Feb 2015 23:40:32 +0000 Subject: If the owner of an object is taking a copy from the scene (e.g. via the "take copy" option on a viewer) then only require owner copy perms, not copy and transfer. This matches Linden Lab behaviour and what was already possible via shift-copy. Transfer would not apply here as the owner and copier are the same. This is the only functional change, all other current take copy logic remains the same. Adds regression tests around relevant take copy cases. --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 23 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index a8883b8..c97a765 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -185,7 +185,7 @@ namespace OpenSim.Tests.Common public void addInventoryItem(InventoryItemBase item) { -// InventoryFolderBase folder = m_folders[item.Folder]; + InventoryFolderBase folder = m_folders[item.Folder]; // m_log.DebugFormat( // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index be3a0cb..2b272e6 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -46,20 +46,33 @@ namespace OpenSim.Tests.Common public XInventoryItem[] GetItems(string[] fields, string[] vals) { +// Console.WriteLine( +// "Requesting items, fields {0}, vals {1}", string.Join(", ", fields), string.Join(", ", vals)); + List origItems = Get(fields, vals, m_allItems.Values.ToList()); - return origItems.Select(i => i.Clone()).ToArray(); + XInventoryItem[] items = origItems.Select(i => i.Clone()).ToArray(); + +// Console.WriteLine("Found {0} items", items.Length); +// Array.ForEach(items, i => Console.WriteLine("Found item {0} {1}", i.inventoryName, i.inventoryID)); + + return items; } public XInventoryFolder[] GetFolders(string[] fields, string[] vals) { // Console.WriteLine( -// "Requesting folders, fields {0}, vals {1}", string.Join(",", fields), string.Join(",", vals)); +// "Requesting folders, fields {0}, vals {1}", string.Join(", ", fields), string.Join(", ", vals)); List origFolders = Get(fields, vals, m_allFolders.Values.ToList()); - return origFolders.Select(f => f.Clone()).ToArray(); + XInventoryFolder[] folders = origFolders.Select(f => f.Clone()).ToArray(); + +// Console.WriteLine("Found {0} folders", folders.Length); +// Array.ForEach(folders, f => Console.WriteLine("Found folder {0} {1}", f.folderName, f.folderID)); + + return folders; } public bool StoreFolder(XInventoryFolder folder) @@ -75,7 +88,9 @@ namespace OpenSim.Tests.Common { m_allItems[item.inventoryID] = item.Clone(); -// Console.WriteLine("Added item {0} {1}, creator {2}, owner {3}", item.inventoryName, item.inventoryID, item.creatorID, item.avatarID); +// Console.WriteLine( +// "Added item {0} {1}, folder {2}, creator {3}, owner {4}", +// item.inventoryName, item.inventoryID, item.parentFolderID, item.creatorID, item.avatarID); return true; } -- cgit v1.1 From b1b72d7c2f16e7d1e239a0579dc0b28ea9812ed7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Feb 2015 20:30:03 +0000 Subject: Reduce coupling in regression test task inventory creation methods to make them usable in tests with no scene present --- .../Tests/Common/Helpers/TaskInventoryHelpers.cs | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index b4bd50b..a15127e 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common /// /// Add a notecard item to the given part. /// - /// + /// /// /// /// UUID or UUID stem @@ -51,16 +51,16 @@ namespace OpenSim.Tests.Common /// The tex to put in the notecard. /// The item that was added public static TaskInventoryItem AddNotecard( - Scene scene, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text) + IAssetService assetService, SceneObjectPart part, string itemName, string itemIDStem, string assetIDStem, string text) { return AddNotecard( - scene, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text); + assetService, part, itemName, TestHelpers.ParseStem(itemIDStem), TestHelpers.ParseStem(assetIDStem), text); } /// /// Add a notecard item to the given part. /// - /// + /// /// /// /// @@ -68,7 +68,7 @@ namespace OpenSim.Tests.Common /// The tex to put in the notecard. /// The item that was added public static TaskInventoryItem AddNotecard( - Scene scene, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text) + IAssetService assetService, SceneObjectPart part, string itemName, UUID itemID, UUID assetID, string text) { AssetNotecard nc = new AssetNotecard(); nc.BodyText = text; @@ -76,7 +76,7 @@ namespace OpenSim.Tests.Common AssetBase ncAsset = AssetHelpers.CreateAsset(assetID, AssetType.Notecard, nc.AssetData, UUID.Zero); - scene.AssetService.Store(ncAsset); + assetService.Store(ncAsset); TaskInventoryItem ncItem = new TaskInventoryItem @@ -94,12 +94,12 @@ namespace OpenSim.Tests.Common /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these /// functions more than once in a test. /// - /// + /// /// /// The item that was added - public static TaskInventoryItem AddScript(Scene scene, SceneObjectPart part) + public static TaskInventoryItem AddScript(IAssetService assetService, SceneObjectPart part) { - return AddScript(scene, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }"); + return AddScript(assetService, part, "scriptItem", "default { state_entry() { llSay(0, \"Hello World\"); } }"); } /// @@ -109,15 +109,15 @@ namespace OpenSim.Tests.Common /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather /// than a random component. /// - /// + /// /// /// Name of the script to add /// LSL script source /// The item that was added public static TaskInventoryItem AddScript( - Scene scene, SceneObjectPart part, string scriptName, string scriptSource) + IAssetService assetService, SceneObjectPart part, string scriptName, string scriptSource) { - return AddScript(scene, part, UUID.Random(), UUID.Random(), scriptName, scriptSource); + return AddScript(assetService, part, UUID.Random(), UUID.Random(), scriptName, scriptSource); } /// @@ -127,7 +127,7 @@ namespace OpenSim.Tests.Common /// TODO: Accept input for item and asset IDs so that we have completely replicatable regression tests rather /// than a random component. /// - /// + /// /// /// Item UUID for the script /// Asset UUID for the script @@ -135,7 +135,7 @@ namespace OpenSim.Tests.Common /// LSL script source /// The item that was added public static TaskInventoryItem AddScript( - Scene scene, SceneObjectPart part, UUID itemId, UUID assetId, string scriptName, string scriptSource) + IAssetService assetService, SceneObjectPart part, UUID itemId, UUID assetId, string scriptName, string scriptSource) { AssetScriptText ast = new AssetScriptText(); ast.Source = scriptSource; @@ -143,7 +143,7 @@ namespace OpenSim.Tests.Common AssetBase asset = AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero); - scene.AssetService.Store(asset); + assetService.Store(asset); TaskInventoryItem item = new TaskInventoryItem { Name = scriptName, AssetID = assetId, ItemID = itemId, @@ -162,17 +162,17 @@ namespace OpenSim.Tests.Common /// functions more than once in a test. /// /// - /// + /// /// /// /// /// public static TaskInventoryItem AddSceneObject( - Scene scene, SceneObjectPart sop, string itemName, UUID id, UUID userId) + IAssetService assetService, SceneObjectPart sop, string itemName, UUID id, UUID userId) { SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero); AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject); - scene.AssetService.Store(taskSceneObjectAsset); + assetService.Store(taskSceneObjectAsset); TaskInventoryItem taskSceneObjectItem = new TaskInventoryItem { Name = itemName, -- cgit v1.1 From a03d893f2c431c220f44a6f7c1b94de7568bd6f8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Feb 2015 21:12:46 +0000 Subject: Fix bug where the uuid gatherer was not inspecting UUIDs for items in an embedded object's inventory. Added regression test for this case. Likely a regression since 08606ae4 (Thu Jan 8 2015) Relates to Mantises 7439, 7450 and possibly others. --- .../Tests/Common/Helpers/TaskInventoryHelpers.cs | 45 ++++++++++++++++------ 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index a15127e..3a3b33a 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -153,7 +153,6 @@ namespace OpenSim.Tests.Common return item; } - /// /// Add a scene object item to the given part. /// @@ -165,25 +164,47 @@ namespace OpenSim.Tests.Common /// /// /// - /// - /// + /// + /// + /// public static TaskInventoryItem AddSceneObject( - IAssetService assetService, SceneObjectPart sop, string itemName, UUID id, UUID userId) + IAssetService assetService, SceneObjectPart sop, string itemName, UUID itemId, SceneObjectGroup soToAdd, UUID soAssetId) { - SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero); - AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject); + AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(soAssetId, soToAdd); assetService.Store(taskSceneObjectAsset); TaskInventoryItem taskSceneObjectItem = new TaskInventoryItem - { Name = itemName, - AssetID = taskSceneObjectAsset.FullID, - ItemID = id, - OwnerID = userId, - Type = (int)AssetType.Object, - InvType = (int)InventoryType.Object }; + { Name = itemName, + AssetID = taskSceneObjectAsset.FullID, + ItemID = itemId, + OwnerID = soToAdd.OwnerID, + Type = (int)AssetType.Object, + InvType = (int)InventoryType.Object }; sop.Inventory.AddInventoryItem(taskSceneObjectItem, true); return taskSceneObjectItem; } + + /// + /// Add a scene object item to the given part. + /// + /// + /// TODO: Accept input for item and asset IDs to avoid mysterious script failures that try to use any of these + /// functions more than once in a test. + /// + /// + /// + /// + /// + /// + /// + public static TaskInventoryItem AddSceneObject( + IAssetService assetService, SceneObjectPart sop, string itemName, UUID itemId, UUID userId) + { + SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, userId); + + return TaskInventoryHelpers.AddSceneObject( + assetService, sop, itemName, itemId, taskSceneObject, TestHelpers.ParseTail(0x10)); + } } } \ No newline at end of file -- cgit v1.1 From bedafb8fae9898ef0c5fc6470236ee7244e616a9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 27 Mar 2015 19:32:50 -0700 Subject: varregion: refactor use of 'double heightmap[,]' into references to new class TerrainData and push the implementation from Scene into the database readers and writers. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 29 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 5c1ec0b..3ab9020 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -69,11 +69,21 @@ namespace OpenSim.Data.Null m_store.StoreTerrain(terrain, regionID); } + public void StoreTerrain(TerrainData terrain, UUID regionID) + { + m_store.StoreTerrain(terrain, regionID); + } + public double[,] LoadTerrain(UUID regionID) { return m_store.LoadTerrain(regionID); } + public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) + { + return m_store.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); + } + public void StoreLandObject(ILandObject Parcel) { m_store.StoreLandObject(Parcel); @@ -159,7 +169,7 @@ namespace OpenSim.Data.Null protected Dictionary m_sceneObjectParts = new Dictionary(); protected Dictionary> m_primItems = new Dictionary>(); - protected Dictionary m_terrains = new Dictionary(); + protected Dictionary m_terrains = new Dictionary(); protected Dictionary m_landData = new Dictionary(); public void Initialise(string dbfile) @@ -304,12 +314,17 @@ namespace OpenSim.Data.Null return new List(objects.Values); } - public void StoreTerrain(double[,] ter, UUID regionID) + public void StoreTerrain(TerrainData ter, UUID regionID) { m_terrains[regionID] = ter; } - public double[,] LoadTerrain(UUID regionID) + public void StoreTerrain(double[,] ter, UUID regionID) + { + m_terrains[regionID] = new HeightmapTerrainData(ter); + } + + public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) { if (m_terrains.ContainsKey(regionID)) return m_terrains[regionID]; @@ -317,6 +332,14 @@ namespace OpenSim.Data.Null return null; } + public double[,] LoadTerrain(UUID regionID) + { + if (m_terrains.ContainsKey(regionID)) + return m_terrains[regionID].GetDoubles(); + else + return null; + } + public void RemoveLandObject(UUID globalID) { if (m_landData.ContainsKey(globalID)) -- cgit v1.1 From 07dead7dcb8b0f2a27a50748e4a460d9669903fc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 29 Mar 2015 14:25:12 -0700 Subject: varregion: any conversions of use of Constants.RegionSize converted into Util.cs routines to convert region coords to and from world coords or handles. --- OpenSim/Tests/Clients/Grid/GridClient.cs | 8 ++++---- OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | 10 +++------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs index 8e33373..fed7a16 100644 --- a/OpenSim/Tests/Clients/Grid/GridClient.cs +++ b/OpenSim/Tests/Clients/Grid/GridClient.cs @@ -150,16 +150,16 @@ namespace OpenSim.Tests.Clients.GridClient Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)"); regions = m_Connector.GetRegionRange(UUID.Zero, - 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize, - 900 * (int)Constants.RegionSize, 1002 * (int) Constants.RegionSize); + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); if (regions == null) Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); else Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 0 regions)"); regions = m_Connector.GetRegionRange(UUID.Zero, - 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize, - 900 * (int)Constants.RegionSize, 950 * (int)Constants.RegionSize); + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950), + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950) ); if (regions == null) Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); else diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index 52a17e7..84de47f 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -69,9 +69,7 @@ namespace OpenSim.Tests.Common tc.OnTestClientInformClientOfNeighbour += (neighbourHandle, neighbourExternalEndPoint) => { uint x, y; - Utils.LongToUInts(neighbourHandle, out x, out y); - x /= Constants.RegionSize; - y /= Constants.RegionSize; + Util.RegionHandleToRegionLoc(neighbourHandle, out x, out y); m_log.DebugFormat( "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}", @@ -104,9 +102,7 @@ namespace OpenSim.Tests.Common += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) => { uint x, y; - Utils.LongToUInts(regionHandle, out x, out y); - x /= Constants.RegionSize; - y /= Constants.RegionSize; + Util.RegionHandleToRegionLoc(regionHandle, out x, out y); m_log.DebugFormat( "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}", @@ -125,4 +121,4 @@ namespace OpenSim.Tests.Common }; } } -} \ No newline at end of file +} -- cgit v1.1 From c2cf22ea4fc42d8582aa6aa2df48a3ce06813d56 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 May 2015 21:04:46 -0700 Subject: Added the beginning of a new test framework for robust connectors and services. For now, just Grid and Presence. This framework starts a robust server (as a thread) listening on a port in localhost, then the tests are client code. --- OpenSim/Tests/Robust/Clients/Grid/GridClient.cs | 133 +++++++++++++++++++++ .../Robust/Clients/Presence/PresenceClient.cs | 81 +++++++++++++ OpenSim/Tests/Robust/Server/DemonServer.cs | 67 +++++++++++ 3 files changed, 281 insertions(+) create mode 100644 OpenSim/Tests/Robust/Clients/Grid/GridClient.cs create mode 100644 OpenSim/Tests/Robust/Clients/Presence/PresenceClient.cs create mode 100644 OpenSim/Tests/Robust/Server/DemonServer.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs b/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs new file mode 100644 index 0000000..671aca7 --- /dev/null +++ b/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs @@ -0,0 +1,133 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +using OpenMetaverse; +using NUnit.Framework; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using OpenSim.Services.Connectors; + +namespace Robust.Tests +{ + [TestFixture] + public class GridClient + { +// private static readonly ILog m_log = +// LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); + + [Test] + public void Grid_001() + { + GridServicesConnector m_Connector = new GridServicesConnector(DemonServer.Address); + + GridRegion r1 = CreateRegion("Test Region 1", 1000, 1000); + GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000); + GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); + + string msg = m_Connector.RegisterRegion(UUID.Zero, r1); + Assert.AreEqual(msg, string.Empty, "Region 1 failed to register"); + + msg = m_Connector.RegisterRegion(UUID.Zero, r2); + Assert.AreEqual(msg, string.Empty, "Region 2 failed to register"); + + msg = m_Connector.RegisterRegion(UUID.Zero, r3); + Assert.AreEqual(msg, string.Empty, "Region 3 failed to register"); + + bool success; + success = m_Connector.DeregisterRegion(r3.RegionID); + Assert.AreEqual(success, true, "Region 3 failed to deregister"); + + msg = m_Connector.RegisterRegion(UUID.Zero, r3); + Assert.AreEqual(msg, string.Empty, "Region 3 failed to re-register"); + + List regions = m_Connector.GetNeighbours(UUID.Zero, r1.RegionID); + Assert.AreNotEqual(regions, null, "GetNeighbours of region 1 failed"); + Assert.AreEqual(regions.Count, 1, "Region 1 should have 1 neighbor"); + Assert.AreEqual(regions[0].RegionName, "Test Region 2", "Region 1 has the wrong neighbor"); + + GridRegion region = m_Connector.GetRegionByUUID(UUID.Zero, r2.RegionID); + Assert.AreNotEqual(region, null, "GetRegionByUUID for region 2 failed"); + Assert.AreEqual(region.RegionName, "Test Region 2", "GetRegionByUUID of region 2 returned wrong region"); + + region = m_Connector.GetRegionByUUID(UUID.Zero, UUID.Random()); + Assert.AreEqual(region, null, "Region with randon id should not exist"); + + region = m_Connector.GetRegionByName(UUID.Zero, r3.RegionName); + Assert.AreNotEqual(region, null, "GetRegionByUUID for region 3 failed"); + Assert.AreEqual(region.RegionName, "Test Region 3", "GetRegionByUUID of region 3 returned wrong region"); + + region = m_Connector.GetRegionByName(UUID.Zero, "Foo"); + Assert.AreEqual(region, null, "Region Foo should not exist"); + + regions = m_Connector.GetRegionsByName(UUID.Zero, "Test", 10); + Assert.AreNotEqual(regions, null, "GetRegionsByName failed"); + Assert.AreEqual(regions.Count, 3, "GetRegionsByName should return 3"); + + regions = m_Connector.GetRegionRange(UUID.Zero, + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); + Assert.AreNotEqual(regions, null, "GetRegionRange failed"); + Assert.AreEqual(regions.Count, 2, "GetRegionRange should return 2"); + + regions = m_Connector.GetRegionRange(UUID.Zero, + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950), + (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950) ); + Assert.AreNotEqual(regions, null, "GetRegionRange (bis) failed"); + Assert.AreEqual(regions.Count, 0, "GetRegionRange (bis) should return 0"); + + // Deregister them all + success = m_Connector.DeregisterRegion(r1.RegionID); + Assert.AreEqual(success, true, "Region 1 failed to deregister"); + + success = m_Connector.DeregisterRegion(r2.RegionID); + Assert.AreEqual(success, true, "Region 2 failed to deregister"); + + success = m_Connector.DeregisterRegion(r3.RegionID); + Assert.AreEqual(success, true, "Region 3 failed to deregister"); + } + + private static GridRegion CreateRegion(string name, uint xcell, uint ycell) + { + GridRegion region = new GridRegion(xcell, ycell); + region.RegionName = name; + region.RegionID = UUID.Random(); + region.ExternalHostName = "127.0.0.1"; + region.HttpPort = 9000; + region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); + + return region; + } + } +} diff --git a/OpenSim/Tests/Robust/Clients/Presence/PresenceClient.cs b/OpenSim/Tests/Robust/Clients/Presence/PresenceClient.cs new file mode 100644 index 0000000..31c8ee9 --- /dev/null +++ b/OpenSim/Tests/Robust/Clients/Presence/PresenceClient.cs @@ -0,0 +1,81 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +using OpenMetaverse; +using NUnit.Framework; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; + +namespace Robust.Tests +{ + [TestFixture] + public class PresenceClient + { + [Test] + public void Presence_001() + { + PresenceServicesConnector m_Connector = new PresenceServicesConnector(DemonServer.Address); + + UUID user1 = UUID.Random(); + UUID session1 = UUID.Random(); + UUID region1 = UUID.Random(); + + bool success = m_Connector.LoginAgent(user1.ToString(), session1, UUID.Zero); + Assert.AreEqual(success, true, "Failed to add user session"); + + PresenceInfo pinfo = m_Connector.GetAgent(session1); + Assert.AreNotEqual(pinfo, null, "Unable to retrieve session"); + Assert.AreEqual(pinfo.UserID, user1.ToString(), "Retrieved session does not match expected userID"); + Assert.AreNotEqual(pinfo.RegionID, region1, "Retrieved session is unexpectedly in region"); + + success = m_Connector.ReportAgent(session1, region1); + Assert.AreEqual(success, true, "Failed to report session in region 1"); + + pinfo = m_Connector.GetAgent(session1); + Assert.AreNotEqual(pinfo, null, "Unable to session presence"); + Assert.AreEqual(pinfo.UserID, user1.ToString(), "Retrieved session does not match expected userID"); + Assert.AreEqual(pinfo.RegionID, region1, "Retrieved session is not in expected region"); + + success = m_Connector.LogoutAgent(session1); + Assert.AreEqual(success, true, "Failed to remove session"); + + pinfo = m_Connector.GetAgent(session1); + Assert.AreEqual(pinfo, null, "Session is still there, even though it shouldn't"); + + success = m_Connector.ReportAgent(session1, UUID.Random()); + Assert.AreEqual(success, false, "Remove non-existing session should fail"); + } + + } +} diff --git a/OpenSim/Tests/Robust/Server/DemonServer.cs b/OpenSim/Tests/Robust/Server/DemonServer.cs new file mode 100644 index 0000000..b51a6bb --- /dev/null +++ b/OpenSim/Tests/Robust/Server/DemonServer.cs @@ -0,0 +1,67 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; + +using Nini.Config; +using log4net; +using NUnit.Framework; + +using OpenSim.Server; + +namespace Robust.Tests +{ + [SetUpFixture] + public class DemonServer : OpenSimServer + { + private Thread m_demon; + + public static string Address = "http://localhost:8888"; + + [SetUp] + public void StartDemon() + { + if (File.Exists("Robust.Tests.log")) + File.Delete("Robust.Tests.log"); + + Console.WriteLine("**** Starting demon Robust server ****"); + m_demon = new Thread( () => Main(new string[] {"-inifile=Robust.Tests.ini"})); + m_demon.Start(); + Console.WriteLine("**** Setup Finished ****"); + } + + [TearDown] + public void StopDemon() + { + Console.WriteLine("**** Killing demon Robust Server ****"); + m_Server.Shutdown(); + } + } +} -- cgit v1.1 From 811b026ed58f432c3b77d1f710c102f355853c9a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 May 2015 21:15:22 -0700 Subject: Deleted OpenSim.Tests.Client.GridClient and PresenceClient, as they have been subsumed by the new testing framework. --- OpenSim/Tests/Clients/Grid/GridClient.cs | 205 ---------------------- OpenSim/Tests/Clients/Grid/GridForm.html | 11 -- OpenSim/Tests/Clients/Presence/OpenSim.Server.ini | 33 ---- OpenSim/Tests/Clients/Presence/PresenceClient.cs | 115 ------------ 4 files changed, 364 deletions(-) delete mode 100644 OpenSim/Tests/Clients/Grid/GridClient.cs delete mode 100644 OpenSim/Tests/Clients/Grid/GridForm.html delete mode 100644 OpenSim/Tests/Clients/Presence/OpenSim.Server.ini delete mode 100644 OpenSim/Tests/Clients/Presence/PresenceClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs deleted file mode 100644 index fed7a16..0000000 --- a/OpenSim/Tests/Clients/Grid/GridClient.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using System.Reflection; - -using OpenMetaverse; -using log4net; -using log4net.Appender; -using log4net.Layout; - -using OpenSim.Framework; -using OpenSim.Services.Interfaces; -using GridRegion = OpenSim.Services.Interfaces.GridRegion; -using OpenSim.Services.Connectors; - -namespace OpenSim.Tests.Clients.GridClient -{ - public class GridClient - { -// private static readonly ILog m_log = -// LogManager.GetLogger( -// MethodBase.GetCurrentMethod().DeclaringType); - - public static void Main(string[] args) - { - ConsoleAppender consoleAppender = new ConsoleAppender(); - consoleAppender.Layout = - new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); - log4net.Config.BasicConfigurator.Configure(consoleAppender); - - string serverURI = "http://127.0.0.1:8001"; - GridServicesConnector m_Connector = new GridServicesConnector(serverURI); - - GridRegion r1 = CreateRegion("Test Region 1", 1000, 1000); - GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000); - GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); - - Console.WriteLine("[GRID CLIENT]: *** Registering region 1"); - string msg = m_Connector.RegisterRegion(UUID.Zero, r1); - if (msg == String.Empty) - Console.WriteLine("[GRID CLIENT]: Successfully registered region 1"); - else - Console.WriteLine("[GRID CLIENT]: region 1 failed to register"); - - Console.WriteLine("[GRID CLIENT]: *** Registering region 2"); - msg = m_Connector.RegisterRegion(UUID.Zero, r2); - if (msg == String.Empty) - Console.WriteLine("[GRID CLIENT]: Successfully registered region 2"); - else - Console.WriteLine("[GRID CLIENT]: region 2 failed to register"); - - Console.WriteLine("[GRID CLIENT]: *** Registering region 3"); - msg = m_Connector.RegisterRegion(UUID.Zero, r3); - if (msg == String.Empty) - Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); - else - Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); - - - bool success; - Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); - success = m_Connector.DeregisterRegion(r3.RegionID); - if (success) - Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); - else - Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); - Console.WriteLine("[GRID CLIENT]: *** Registering region 3 again"); - msg = m_Connector.RegisterRegion(UUID.Zero, r3); - if (msg == String.Empty) - Console.WriteLine("[GRID CLIENT]: Successfully registered region 3"); - else - Console.WriteLine("[GRID CLIENT]: region 3 failed to register"); - - Console.WriteLine("[GRID CLIENT]: *** GetNeighbours of region 1"); - List regions = m_Connector.GetNeighbours(UUID.Zero, r1.RegionID); - if (regions == null) - Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 failed"); - else if (regions.Count > 0) - { - if (regions.Count != 1) - Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned more neighbours than expected: " + regions.Count); - else - Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned the right neighbour " + regions[0].RegionName); - } - else - Console.WriteLine("[GRID CLIENT]: GetNeighbours of region 1 returned 0 neighbours"); - - - Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of region 2 (this should succeed)"); - GridRegion region = m_Connector.GetRegionByUUID(UUID.Zero, r2.RegionID); - if (region == null) - Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); - else - Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); - - Console.WriteLine("[GRID CLIENT]: *** GetRegionByUUID of non-existent region (this should fail)"); - region = m_Connector.GetRegionByUUID(UUID.Zero, UUID.Random()); - if (region == null) - Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned null"); - else - Console.WriteLine("[GRID CLIENT]: GetRegionByUUID returned region " + region.RegionName); - - Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of region 3 (this should succeed)"); - region = m_Connector.GetRegionByName(UUID.Zero, r3.RegionName); - if (region == null) - Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); - else - Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); - - Console.WriteLine("[GRID CLIENT]: *** GetRegionByName of non-existent region (this should fail)"); - region = m_Connector.GetRegionByName(UUID.Zero, "Foo"); - if (region == null) - Console.WriteLine("[GRID CLIENT]: GetRegionByName returned null"); - else - Console.WriteLine("[GRID CLIENT]: GetRegionByName returned region " + region.RegionName); - - Console.WriteLine("[GRID CLIENT]: *** GetRegionsByName (this should return 3 regions)"); - regions = m_Connector.GetRegionsByName(UUID.Zero, "Test", 10); - if (regions == null) - Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned null"); - else - Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned " + regions.Count + " regions"); - - Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)"); - regions = m_Connector.GetRegionRange(UUID.Zero, - (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), - (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); - if (regions == null) - Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); - else - Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); - Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 0 regions)"); - regions = m_Connector.GetRegionRange(UUID.Zero, - (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950), - (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(950) ); - if (regions == null) - Console.WriteLine("[GRID CLIENT]: GetRegionRange returned null"); - else - Console.WriteLine("[GRID CLIENT]: GetRegionRange returned " + regions.Count + " regions"); - - Console.Write("Proceed to deregister? Press enter..."); - Console.ReadLine(); - - // Deregister them all - Console.WriteLine("[GRID CLIENT]: *** Deregistering region 1"); - success = m_Connector.DeregisterRegion(r1.RegionID); - if (success) - Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 1"); - else - Console.WriteLine("[GRID CLIENT]: region 1 failed to deregister"); - Console.WriteLine("[GRID CLIENT]: *** Deregistering region 2"); - success = m_Connector.DeregisterRegion(r2.RegionID); - if (success) - Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 2"); - else - Console.WriteLine("[GRID CLIENT]: region 2 failed to deregister"); - Console.WriteLine("[GRID CLIENT]: *** Deregistering region 3"); - success = m_Connector.DeregisterRegion(r3.RegionID); - if (success) - Console.WriteLine("[GRID CLIENT]: Successfully deregistered region 3"); - else - Console.WriteLine("[GRID CLIENT]: region 3 failed to deregister"); - - } - - private static GridRegion CreateRegion(string name, uint xcell, uint ycell) - { - GridRegion region = new GridRegion(xcell, ycell); - region.RegionName = name; - region.RegionID = UUID.Random(); - region.ExternalHostName = "127.0.0.1"; - region.HttpPort = 9000; - region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); - - return region; - } - } -} diff --git a/OpenSim/Tests/Clients/Grid/GridForm.html b/OpenSim/Tests/Clients/Grid/GridForm.html deleted file mode 100644 index 252920f..0000000 --- a/OpenSim/Tests/Clients/Grid/GridForm.html +++ /dev/null @@ -1,11 +0,0 @@ - - -
-xmin: -xmax: -ymin: -ymax: - - -
- diff --git a/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini b/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini deleted file mode 100644 index 8610c78..0000000 --- a/OpenSim/Tests/Clients/Presence/OpenSim.Server.ini +++ /dev/null @@ -1,33 +0,0 @@ -; * Run a ROBUST server shell like this, from bin: -; * $ OpenSim.Server.exe -inifile ../OpenSim/Tests/Clients/Presence/OpenSim.Server.ini -; * -; * Then run this client like this, from bin: -; * $ OpenSim.Tests.Clients.PresenceClient.exe -; * -; * - -[Startup] -ServiceConnectors = "OpenSim.Server.Handlers.dll:PresenceServiceConnector" - -; * This is common for all services, it's the network setup for the entire -; * server instance -; * -[Network] -port = 8003 - -; * The following are for the remote console -; * They have no effect for the local or basic console types -; * Leave commented to diable logins to the console -;ConsoleUser = Test -;ConsolePass = secret - -; * As an example, the below configuration precisely mimicks the legacy -; * asset server. It is read by the asset IN connector (defined above) -; * and it then loads the OUT connector (a local database module). That, -; * in turn, reads the asset loader and database connection information -; * -[PresenceService] - LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService" - StorageProvider = "OpenSim.Data.MySQL.dll" - ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;Old Guids=true;" - diff --git a/OpenSim/Tests/Clients/Presence/PresenceClient.cs b/OpenSim/Tests/Clients/Presence/PresenceClient.cs deleted file mode 100644 index fd3905a..0000000 --- a/OpenSim/Tests/Clients/Presence/PresenceClient.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using System.Reflection; - -using OpenMetaverse; -using log4net; -using log4net.Appender; -using log4net.Layout; - -using OpenSim.Framework; -using OpenSim.Services.Interfaces; -using OpenSim.Services.Connectors; - -namespace OpenSim.Tests.Clients.PresenceClient -{ - public class PresenceClient - { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); - - public static void Main(string[] args) - { - ConsoleAppender consoleAppender = new ConsoleAppender(); - consoleAppender.Layout = - new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); - log4net.Config.BasicConfigurator.Configure(consoleAppender); - - string serverURI = "http://127.0.0.1:8003"; - PresenceServicesConnector m_Connector = new PresenceServicesConnector(serverURI); - - UUID user1 = UUID.Random(); - UUID session1 = UUID.Random(); - UUID region1 = UUID.Random(); - - bool success = m_Connector.LoginAgent(user1.ToString(), session1, UUID.Zero); - if (success) - m_log.InfoFormat("[PRESENCE CLIENT]: Successfully logged in user {0} with session {1}", user1, session1); - else - m_log.InfoFormat("[PRESENCE CLIENT]: failed to login user {0}", user1); - - System.Console.WriteLine("\n"); - - PresenceInfo pinfo = m_Connector.GetAgent(session1); - if (pinfo == null) - m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0}", user1); - else - m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}", - pinfo.UserID, pinfo.RegionID); - - System.Console.WriteLine("\n"); - success = m_Connector.ReportAgent(session1, region1); - if (success) - m_log.InfoFormat("[PRESENCE CLIENT]: Successfully reported session {0} in region {1}", user1, region1); - else - m_log.InfoFormat("[PRESENCE CLIENT]: failed to report session {0}", session1); - pinfo = m_Connector.GetAgent(session1); - if (pinfo == null) - m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for second time", user1); - else - m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={2}", - pinfo.UserID, pinfo.RegionID); - - System.Console.WriteLine("\n"); - success = m_Connector.LogoutAgent(session1); - if (success) - m_log.InfoFormat("[PRESENCE CLIENT]: Successfully logged out user {0}", user1); - else - m_log.InfoFormat("[PRESENCE CLIENT]: failed to logout user {0}", user1); - pinfo = m_Connector.GetAgent(session1); - if (pinfo == null) - m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for fourth time", user1); - else - m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}", - pinfo.UserID, pinfo.RegionID); - - System.Console.WriteLine("\n"); - success = m_Connector.ReportAgent(session1, UUID.Random()); - if (success) - m_log.InfoFormat("[PRESENCE CLIENT]: Report agent succeeded, but this is wrong"); - else - m_log.InfoFormat("[PRESENCE CLIENT]: failed to report agent, as it should because user is not logged in"); - - } - - } -} -- cgit v1.1 From 4b94fb8443ff2e6f0aa7b176ca81e5021d6f59b6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 May 2015 21:16:12 -0700 Subject: Added this form that comes handy for testing the grid service in Robust. --- OpenSim/Tests/Robust/Clients/Grid/GridForm.html | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 OpenSim/Tests/Robust/Clients/Grid/GridForm.html (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Grid/GridForm.html b/OpenSim/Tests/Robust/Clients/Grid/GridForm.html new file mode 100644 index 0000000..252920f --- /dev/null +++ b/OpenSim/Tests/Robust/Clients/Grid/GridForm.html @@ -0,0 +1,11 @@ + + +
+xmin: +xmax: +ymin: +ymax: + + +
+ -- cgit v1.1 From eb9b16d2849de438f20bb269ef3ea93e33f4d18d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 10 May 2015 21:49:24 -0700 Subject: Added simple test for IM in Robust too. Changed Inventory data to use the mock one in Common Tests. (but still not inventory tests) --- OpenSim/Tests/Clients/InstantMessage/IMClient.cs | 75 ---------------------- .../Robust/Clients/InstantMessage/IMClient.cs | 58 +++++++++++++++++ 2 files changed, 58 insertions(+), 75 deletions(-) delete mode 100644 OpenSim/Tests/Clients/InstantMessage/IMClient.cs create mode 100644 OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs b/OpenSim/Tests/Clients/InstantMessage/IMClient.cs deleted file mode 100644 index e7304a2..0000000 --- a/OpenSim/Tests/Clients/InstantMessage/IMClient.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using System.Reflection; - -using OpenMetaverse; -using log4net; -using log4net.Appender; -using log4net.Layout; - -using OpenSim.Framework; -using OpenSim.Services.Interfaces; -using OpenSim.Services.Connectors.InstantMessage; - -namespace OpenSim.Tests.Clients.InstantMessage -{ - public class IMClient - { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); - - public static void Main(string[] args) - { - ConsoleAppender consoleAppender = new ConsoleAppender(); - consoleAppender.Layout = - new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); - log4net.Config.BasicConfigurator.Configure(consoleAppender); - - string serverURI = "http://127.0.0.1:8002"; - GridInstantMessage im = new GridInstantMessage(); - im.fromAgentID = new Guid(); - im.toAgentID = new Guid(); - im.message = "Hello"; - im.imSessionID = new Guid(); - - bool success = InstantMessageServiceConnector.SendInstantMessage(serverURI, im); - - if (success) - m_log.InfoFormat("[IM CLIENT]: Successfully IMed {0}", serverURI); - else - m_log.InfoFormat("[IM CLIENT]: failed to IM {0}", serverURI); - - System.Console.WriteLine("\n"); - } - - } -} diff --git a/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs new file mode 100644 index 0000000..8f312eb --- /dev/null +++ b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs @@ -0,0 +1,58 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Text; + +using OpenMetaverse; +using NUnit.Framework; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors.InstantMessage; + +namespace Robust.Tests +{ + [TestFixture] + public class IMClient + { + [Test] + public void HGIM_001() + { + GridInstantMessage im = new GridInstantMessage(); + im.fromAgentID = new Guid(); + im.toAgentID = new Guid(); + im.message = "Hello"; + im.imSessionID = new Guid(); + + bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im); + Assert.IsFalse(success, "Sending of IM succeeded, but it should have failed"); + } + + } +} -- cgit v1.1 From 3df472f10d1a2b8387e998c4f4c871eaf9a73ac2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 May 2015 08:52:12 -0700 Subject: Added inventory tests to Robust.Tests. --- .../Robust/Clients/Inventory/InventoryClient.cs | 152 +++++++++++++++++++++ OpenSim/Tests/Robust/Server/DemonServer.cs | 2 + 2 files changed, 154 insertions(+) create mode 100644 OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs new file mode 100644 index 0000000..78a7dc8 --- /dev/null +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -0,0 +1,152 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +using OpenMetaverse; +using NUnit.Framework; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; + +namespace Robust.Tests +{ + [TestFixture] + public class InventoryClient + { +// private static readonly ILog m_log = +// LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); + + private UUID m_userID = new UUID("00000000-0000-0000-0000-333333333333"); + private UUID m_rootFolderID; + private UUID m_notecardsFolder; + private UUID m_objectsFolder; + + [Test] + public void Inventory_001_CreateInventory() + { + XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); + + // Create an inventory that looks like this: + // + // /My Inventory + // + // /Objects + // Some Object + // /Notecards + // Notecard 1 + // Notecard 2 + // /Test Folder + // Link to notecard -> /Notecards/Notecard 2 + // Link to Objects folder -> /Objects + + Console.WriteLine("Starting inventory test"); + bool success = m_Connector.CreateUserInventory(m_userID); + Assert.IsTrue(success, "Failed to create user inventory"); + + m_rootFolderID = m_Connector.GetRootFolder(m_userID).ID; + Assert.AreNotEqual(m_rootFolderID, UUID.Zero, "Root folder ID must not be UUID.Zero"); + + InventoryFolderBase of = m_Connector.GetFolderForType(m_userID, AssetType.Object); + Assert.IsNotNull(of, "Failed to retrieve Objects folder"); + m_objectsFolder = of.ID; + Assert.AreNotEqual(m_objectsFolder, UUID.Zero, "Objects folder ID must not be UUID.Zero"); + + // Add an object + InventoryItemBase item = new InventoryItemBase(new UUID("b0000000-0000-0000-0000-00000000000b"), m_userID); + item.AssetID = UUID.Random(); + item.AssetType = (int)AssetType.Object; + item.Folder = m_objectsFolder; + item.Name = "Some Object"; + item.Description = string.Empty; + success = m_Connector.AddItem(item); + Assert.IsTrue(success, "Failed to add object to inventory"); + + InventoryFolderBase ncf = m_Connector.GetFolderForType(m_userID, AssetType.Notecard); + Assert.IsNotNull(of, "Failed to retrieve Notecards folder"); + m_notecardsFolder = ncf.ID; + Assert.AreNotEqual(m_notecardsFolder, UUID.Zero, "Notecards folder ID must not be UUID.Zero"); + m_notecardsFolder = ncf.ID; + + // Add a notecard + item = new InventoryItemBase(new UUID("10000000-0000-0000-0000-000000000001"), m_userID); + item.AssetID = UUID.Random(); + item.AssetType = (int)AssetType.Notecard; + item.Folder = m_notecardsFolder; + item.Name = "Test Notecard 1"; + item.Description = string.Empty; + success = m_Connector.AddItem(item); + Assert.IsTrue(success, "Failed to add Notecard 1 to inventory"); + // Add another notecard + item.ID = new UUID("20000000-0000-0000-0000-000000000002"); + item.AssetID = new UUID("a0000000-0000-0000-0000-00000000000a"); + item.Name = "Test Notecard 2"; + item.Description = string.Empty; + success = m_Connector.AddItem(item); + Assert.IsTrue(success, "Failed to add Notecard 2 to inventory"); + + // Add a folder + InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID); + folder.Type = (int)AssetType.Folder; + success = m_Connector.AddFolder(folder); + Assert.IsTrue(success, "Failed to add Test Folder to inventory"); + + // Add a link to notecard 2 in Test Folder + item.AssetID = item.ID; // use item ID of notecard 2 + item.ID = new UUID("40000000-0000-0000-0000-000000000004"); + item.AssetType = (int)AssetType.Link; + item.Folder = folder.ID; + item.Name = "Link to notecard"; + item.Description = string.Empty; + success = m_Connector.AddItem(item); + Assert.IsTrue(success, "Failed to add link to notecard to inventory"); + + // Add a link to the Objects folder in Test Folder + item.AssetID = m_Connector.GetFolderForType(m_userID, AssetType.Object).ID; // use item ID of Objects folder + item.ID = new UUID("50000000-0000-0000-0000-000000000005"); + item.AssetType = (int)AssetType.LinkFolder; + item.Folder = folder.ID; + item.Name = "Link to Objects folder"; + item.Description = string.Empty; + success = m_Connector.AddItem(item); + Assert.IsTrue(success, "Failed to add link to objects folder to inventory"); + + InventoryCollection coll = m_Connector.GetFolderContent(m_userID, m_rootFolderID); + Assert.IsNotNull(coll, "Failed to retrieve contents of root folder"); + Assert.Greater(coll.Folders.Count, 0, "Root folder does not have any subfolders"); + + coll = m_Connector.GetFolderContent(m_userID, folder.ID); + Assert.IsNotNull(coll, "Failed to retrieve contents of Test Folder"); + Assert.AreEqual(coll.Items.Count + coll.Folders.Count, 2, "Test Folder is expected to have exactly 2 things inside"); + } + } +} diff --git a/OpenSim/Tests/Robust/Server/DemonServer.cs b/OpenSim/Tests/Robust/Server/DemonServer.cs index b51a6bb..1e0797e 100644 --- a/OpenSim/Tests/Robust/Server/DemonServer.cs +++ b/OpenSim/Tests/Robust/Server/DemonServer.cs @@ -54,6 +54,8 @@ namespace Robust.Tests Console.WriteLine("**** Starting demon Robust server ****"); m_demon = new Thread( () => Main(new string[] {"-inifile=Robust.Tests.ini"})); m_demon.Start(); + // Give some time for the server to instantiate all services + Thread.Sleep(3000); Console.WriteLine("**** Setup Finished ****"); } -- cgit v1.1 From c20a5dd75a31c99939046d5fb59769d8fff43531 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 May 2015 09:05:09 -0700 Subject: Trivial change just to trigger jenkins to build again --- OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 78a7dc8..9d3f400 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -147,6 +147,7 @@ namespace Robust.Tests coll = m_Connector.GetFolderContent(m_userID, folder.ID); Assert.IsNotNull(coll, "Failed to retrieve contents of Test Folder"); Assert.AreEqual(coll.Items.Count + coll.Folders.Count, 2, "Test Folder is expected to have exactly 2 things inside"); + } } } -- cgit v1.1 From 923a57a91fa9629a844da6cd59ca8e9d2b0fbcde Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 11 May 2015 19:55:23 -0700 Subject: Added tests for UserAccountService in Robust. In the process fixed a couple of bugs in the network connectors. For some reason the robust-bound code had a CreateUser method, while the client-bound code had no such method. I assume someone is extending the client-side code with their own connectors. I added the missing method, but didn't add it to the service interface. --- .../Tests/Clients/UserAccounts/OpenSim.Server.ini | 33 ----- .../Clients/UserAccounts/UserAccountsClient.cs | 144 --------------------- .../Clients/UserAccounts/UserAccountsClient.cs | 81 ++++++++++++ 3 files changed, 81 insertions(+), 177 deletions(-) delete mode 100644 OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini delete mode 100644 OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs create mode 100644 OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini b/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini deleted file mode 100644 index 453e17e..0000000 --- a/OpenSim/Tests/Clients/UserAccounts/OpenSim.Server.ini +++ /dev/null @@ -1,33 +0,0 @@ -; * Run a ROBUST server shell like this, from bin: -; * $ OpenSim.Server.exe -inifile ../OpenSim/Tests/Clients/Presence/OpenSim.Server.ini -; * -; * Then run this client like this, from bin: -; * $ OpenSim.Tests.Clients.UserAccountClient.exe -; * -; * - -[Startup] -ServiceConnectors = "OpenSim.Server.Handlers.dll:UserAccountServiceConnector" - -; * This is common for all services, it's the network setup for the entire -; * server instance -; * -[Network] -port = 8003 - -; * The following are for the remote console -; * They have no effect for the local or basic console types -; * Leave commented to diable logins to the console -;ConsoleUser = Test -;ConsolePass = secret - -; * As an example, the below configuration precisely mimicks the legacy -; * asset server. It is read by the asset IN connector (defined above) -; * and it then loads the OUT connector (a local database module). That, -; * in turn, reads the asset loader and database connection information -; * -[UserAccountService] - LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" - StorageProvider = "OpenSim.Data.MySQL.dll" - ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;Old Guids=true;" - diff --git a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs deleted file mode 100644 index 1e0a35b..0000000 --- a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; -using System.Reflection; - -using OpenMetaverse; -using log4net; -using log4net.Appender; -using log4net.Layout; - -using OpenSim.Framework; -using OpenSim.Services.Interfaces; -using OpenSim.Services.Connectors; - -namespace OpenSim.Tests.Clients.PresenceClient -{ - public class UserAccountsClient - { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); - - public static void Main(string[] args) - { - ConsoleAppender consoleAppender = new ConsoleAppender(); - consoleAppender.Layout = - new PatternLayout("%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"); - log4net.Config.BasicConfigurator.Configure(consoleAppender); - - string serverURI = "http://127.0.0.1:8003"; - UserAccountServicesConnector m_Connector = new UserAccountServicesConnector(serverURI); - - UUID user1 = UUID.Random(); - string first = "Completely"; - string last = "Clueless"; - string email = "foo@bar.com"; - - //UserAccount account = new UserAccount(user1); - //account.ScopeID = UUID.Zero; - //account.FirstName = first; - //account.LastName = last; - //account.Email = email; - //account.ServiceURLs = new Dictionary(); - //account.ServiceURLs.Add("InventoryServerURI", "http://cnn.com"); - //account.ServiceURLs.Add("AssetServerURI", "http://cnn.com"); - - //bool success = m_Connector.StoreUserAccount(account); - //if (success) - // m_log.InfoFormat("[USER CLIENT]: Successfully created account for user {0} {1}", account.FirstName, account.LastName); - //else - // m_log.InfoFormat("[USER CLIENT]: failed to create user {0} {1}", account.FirstName, account.LastName); - - //System.Console.WriteLine("\n"); - - //account = m_Connector.GetUserAccount(UUID.Zero, user1); - //if (account == null) - // m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); - //else - //{ - // m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", - // account.PrincipalID, account.FirstName, account.LastName, account.Email); - // foreach (KeyValuePair kvp in account.ServiceURLs) - // m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); - //} - - //System.Console.WriteLine("\n"); - - UserAccount account = m_Connector.GetUserAccount(UUID.Zero, first, last); - if (account == null) - m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by name "); - else - { - m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", - account.PrincipalID, account.FirstName, account.LastName, account.Email); - foreach (KeyValuePair kvp in account.ServiceURLs) - m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); - } - - System.Console.WriteLine("\n"); - account = m_Connector.GetUserAccount(UUID.Zero, email); - if (account == null) - m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by email"); - else - { - m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", - account.PrincipalID, account.FirstName, account.LastName, account.Email); - foreach (KeyValuePair kvp in account.ServiceURLs) - m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); - } - - System.Console.WriteLine("\n"); - account = m_Connector.GetUserAccount(UUID.Zero, user1); - if (account == null) - m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); - else - { - m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", - account.PrincipalID, account.FirstName, account.LastName, account.Email); - foreach (KeyValuePair kvp in account.ServiceURLs) - m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); - } - - System.Console.WriteLine("\n"); - account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); - if (account == null) - m_log.InfoFormat("[USER CLIENT]: Unable to retrieve account 'DoesNot Exist'"); - else - { - m_log.InfoFormat("[USER CLIENT]: Account 'DoesNot Exist' retrieved correctly. REALLY??? userID={0}; FirstName={1}; LastName={2}; Email={3}", - account.PrincipalID, account.FirstName, account.LastName, account.Email); - foreach (KeyValuePair kvp in account.ServiceURLs) - m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); - } - } - - } -} diff --git a/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs new file mode 100644 index 0000000..2f92123 --- /dev/null +++ b/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs @@ -0,0 +1,81 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +using OpenMetaverse; +using NUnit.Framework; + +using OpenSim.Framework; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors; + +namespace Robust.Tests +{ + [TestFixture] + public class UserAccountsClient + { + [Test] + public void UserAccounts_001() + { + UserAccountServicesConnector m_Connector = new UserAccountServicesConnector(DemonServer.Address); + + string first = "Completely"; + string last = "Clueless"; + string email = "foo@bar.com"; + + UserAccount account = m_Connector.CreateUser(first, last, "123", email, UUID.Zero); + Assert.IsNotNull(account, "Failed to create account " + first + " " + last); + UUID user1 = account.PrincipalID; + + account = m_Connector.GetUserAccount(UUID.Zero, user1); + Assert.NotNull(account, "Failed to retrieve account for user id " + user1); + Assert.AreEqual(account.FirstName, first, "First name does not match"); + Assert.AreEqual(account.LastName, last, "Last name does not match"); + + account = m_Connector.GetUserAccount(UUID.Zero, first, last); + Assert.IsNotNull(account, "Failed to retrieve account for user " + first + " " + last); + Assert.AreEqual(account.FirstName, first, "First name does not match (bis)"); + Assert.AreEqual(account.LastName, last, "Last name does not match (bis)"); + + account.Email = "user@example.com"; + bool success = m_Connector.StoreUserAccount(account); + Assert.IsTrue(success, "Failed to store account"); + + account = m_Connector.GetUserAccount(UUID.Zero, user1); + Assert.NotNull(account, "Failed to retrieve account for user id " + user1); + Assert.AreEqual(account.Email, "user@example.com", "Incorrect email"); + + account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); + Assert.IsNull(account, "Account DoesNot Exit must not be there"); + } + + } +} -- cgit v1.1 From aefed571587a620948ef283411d71732a10a3522 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 12 May 2015 08:55:32 -0700 Subject: One more test in UserAccountsClient. --- OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs index 2f92123..2c327e8 100644 --- a/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs +++ b/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs @@ -67,7 +67,7 @@ namespace Robust.Tests account.Email = "user@example.com"; bool success = m_Connector.StoreUserAccount(account); - Assert.IsTrue(success, "Failed to store account"); + Assert.IsTrue(success, "Failed to store existing account"); account = m_Connector.GetUserAccount(UUID.Zero, user1); Assert.NotNull(account, "Failed to retrieve account for user id " + user1); @@ -75,6 +75,10 @@ namespace Robust.Tests account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); Assert.IsNull(account, "Account DoesNot Exit must not be there"); + + account = new UserAccount(UUID.Zero, "DoesNot", "Exist", "xxx@xxx.com"); + success = m_Connector.StoreUserAccount(account); + Assert.IsFalse(success, "Storing a non-existing account must fail"); } } -- cgit v1.1 From 35d58fe9d489dbb20ee7bc4574b0084e12ff9ae0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 25 May 2015 15:19:00 -0700 Subject: Minor change of statement order in unit test --- OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs index 2c327e8..3238dc9 100644 --- a/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs +++ b/OpenSim/Tests/Robust/Clients/UserAccounts/UserAccountsClient.cs @@ -73,12 +73,13 @@ namespace Robust.Tests Assert.NotNull(account, "Failed to retrieve account for user id " + user1); Assert.AreEqual(account.Email, "user@example.com", "Incorrect email"); - account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); - Assert.IsNull(account, "Account DoesNot Exit must not be there"); - account = new UserAccount(UUID.Zero, "DoesNot", "Exist", "xxx@xxx.com"); success = m_Connector.StoreUserAccount(account); Assert.IsFalse(success, "Storing a non-existing account must fail"); + + account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); + Assert.IsNull(account, "Account DoesNot Exist must not be there"); + } } -- cgit v1.1 From 6f469ec0a5de7633e9380eb1b370590c288cff26 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 4 Jun 2015 08:52:57 -0700 Subject: Added tests that verify the absence of the bug fixed in the previous commits (cache issues). --- .../Robust/Clients/Inventory/InventoryClient.cs | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 9d3f400..1dcda0b 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -37,6 +37,8 @@ using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Services.Connectors; +using OpenSim.Tests.Common; + namespace Robust.Tests { [TestFixture] @@ -54,6 +56,7 @@ namespace Robust.Tests [Test] public void Inventory_001_CreateInventory() { + TestHelpers.InMethod(); XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); // Create an inventory that looks like this: @@ -69,7 +72,6 @@ namespace Robust.Tests // Link to notecard -> /Notecards/Notecard 2 // Link to Objects folder -> /Objects - Console.WriteLine("Starting inventory test"); bool success = m_Connector.CreateUserInventory(m_userID); Assert.IsTrue(success, "Failed to create user inventory"); @@ -149,5 +151,31 @@ namespace Robust.Tests Assert.AreEqual(coll.Items.Count + coll.Folders.Count, 2, "Test Folder is expected to have exactly 2 things inside"); } + + [Test] + public void Inventory_002_DoubleItemsRequest() + { + TestHelpers.InMethod(); + XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); + + // Prefetch Notecard 1, will be cached from here on + InventoryItemBase item = new InventoryItemBase(new UUID("10000000-0000-0000-0000-000000000001"), m_userID); + item = m_Connector.GetItem(item); + Assert.NotNull(item, "Failed to get Notecard 1"); + Assert.AreEqual("Test Notecard 1", item.Name, "Wrong name for Notecard 1"); + + UUID[] uuids = new UUID[2]; + uuids[0] = item.ID; + uuids[1] = new UUID("20000000-0000-0000-0000-000000000002"); + + InventoryItemBase[] items = m_Connector.GetMultipleItems(m_userID, uuids); + Assert.NotNull(items, "Failed to get multiple items"); + Assert.IsTrue(items.Length == 2, "Requested 2 items, but didn't receive 2 items"); + + // Now they should both be cached + items = m_Connector.GetMultipleItems(m_userID, uuids); + Assert.NotNull(items, "(Repeat) Failed to get multiple items"); + Assert.IsTrue(items.Length == 2, "(Repeat) Requested 2 items, but didn't receive 2 items"); + } } } -- cgit v1.1 From 2fff376762c8af8f777b54ac73067142f0b1e9e7 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 4 Jun 2015 09:17:12 -0700 Subject: More assertions in inventory client tests to check for assorted combinations of cached/non-cached/existing/non-existing items --- .../Robust/Clients/Inventory/InventoryClient.cs | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 1dcda0b..c388ec1 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -153,7 +153,7 @@ namespace Robust.Tests } [Test] - public void Inventory_002_DoubleItemsRequest() + public void Inventory_002_MultipleItemsRequest() { TestHelpers.InMethod(); XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); @@ -176,6 +176,31 @@ namespace Robust.Tests items = m_Connector.GetMultipleItems(m_userID, uuids); Assert.NotNull(items, "(Repeat) Failed to get multiple items"); Assert.IsTrue(items.Length == 2, "(Repeat) Requested 2 items, but didn't receive 2 items"); + + // This item doesn't exist, but [0] does, and it's cached. + uuids[1] = new UUID("bb000000-0000-0000-0000-0000000000bb"); + // Fetching should return 2 items, but [1] should be null + items = m_Connector.GetMultipleItems(m_userID, uuids); + Assert.NotNull(items, "(Three times) Failed to get multiple items"); + Assert.IsTrue(items.Length == 2, "(Three times) Requested 2 items, but didn't receive 2 items"); + Assert.AreEqual("Test Notecard 1", items[0].Name, "(Three times) Wrong name for Notecard 1"); + Assert.IsNull(items[1], "(Three times) Expecting 2nd item to be null"); + + // Now both don't exist + uuids[0] = new UUID("aa000000-0000-0000-0000-0000000000aa"); + items = m_Connector.GetMultipleItems(m_userID, uuids); + Assert.Null(items[0], "Request to multiple non-existent items is supposed to return null [0]"); + Assert.Null(items[1], "Request to multiple non-existent items is supposed to return null [0]"); + + // This item exists, and it's not cached + uuids[1] = new UUID("b0000000-0000-0000-0000-00000000000b"); + // Fetching should return 2 items, but [0] should be null + items = m_Connector.GetMultipleItems(m_userID, uuids); + Assert.NotNull(items, "(Four times) Failed to get multiple items"); + Assert.IsTrue(items.Length == 2, "(Four times) Requested 2 items, but didn't receive 2 items"); + Assert.AreEqual("Some Object", items[1].Name, "(Four times) Wrong name for Some Object"); + Assert.IsNull(items[0], "(Four times) Expecting 1st item to be null"); + } } } -- cgit v1.1 From f63e7ec46f9a09d758791a4ed265d3384d6a14c5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 4 Jun 2015 09:30:41 -0700 Subject: Trivial: fix copy-paste typo in string --- OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index c388ec1..2fb0751 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -190,7 +190,7 @@ namespace Robust.Tests uuids[0] = new UUID("aa000000-0000-0000-0000-0000000000aa"); items = m_Connector.GetMultipleItems(m_userID, uuids); Assert.Null(items[0], "Request to multiple non-existent items is supposed to return null [0]"); - Assert.Null(items[1], "Request to multiple non-existent items is supposed to return null [0]"); + Assert.Null(items[1], "Request to multiple non-existent items is supposed to return null [1]"); // This item exists, and it's not cached uuids[1] = new UUID("b0000000-0000-0000-0000-00000000000b"); -- cgit v1.1 From 959872315f67a1a33a2bae7330749f7dd74a4774 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 8 Aug 2015 12:12:50 -0700 Subject: WARNING: massive refactor to follow libomv's latest changes regarding inventory folders. The newest version of libomv itself is committed here. Basically, everything that was using the AssetType enum has been combed through; many of those uses were changed to the new FolderType enum. This means that from now on, [new] root folders have code 8 (FolderType.Root), as the viewers expect, as opposed to 9, which was what we had been doing. Normal folders are as they were, -1. Also now sending folder code 100 for Suitcase folders to viewers, with no filter. All tests pass, but fingers crossed! --- OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs | 2 +- OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index b3b75af..5a36332 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -102,7 +102,7 @@ namespace OpenSim.Tests.Common { return AddInventoryItem( scene, itemName, itemId, itemType, asset, userId, - scene.InventoryService.GetFolderForType(userId, (AssetType)asset.Type).Name); + scene.InventoryService.GetFolderForType(userId, (FolderType)asset.Type).Name); } /// diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 2fb0751..0280b73 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -78,7 +78,7 @@ namespace Robust.Tests m_rootFolderID = m_Connector.GetRootFolder(m_userID).ID; Assert.AreNotEqual(m_rootFolderID, UUID.Zero, "Root folder ID must not be UUID.Zero"); - InventoryFolderBase of = m_Connector.GetFolderForType(m_userID, AssetType.Object); + InventoryFolderBase of = m_Connector.GetFolderForType(m_userID, FolderType.Object); Assert.IsNotNull(of, "Failed to retrieve Objects folder"); m_objectsFolder = of.ID; Assert.AreNotEqual(m_objectsFolder, UUID.Zero, "Objects folder ID must not be UUID.Zero"); @@ -93,7 +93,7 @@ namespace Robust.Tests success = m_Connector.AddItem(item); Assert.IsTrue(success, "Failed to add object to inventory"); - InventoryFolderBase ncf = m_Connector.GetFolderForType(m_userID, AssetType.Notecard); + InventoryFolderBase ncf = m_Connector.GetFolderForType(m_userID, FolderType.Notecard); Assert.IsNotNull(of, "Failed to retrieve Notecards folder"); m_notecardsFolder = ncf.ID; Assert.AreNotEqual(m_notecardsFolder, UUID.Zero, "Notecards folder ID must not be UUID.Zero"); @@ -118,7 +118,7 @@ namespace Robust.Tests // Add a folder InventoryFolderBase folder = new InventoryFolderBase(new UUID("f0000000-0000-0000-0000-00000000000f"), "Test Folder", m_userID, m_rootFolderID); - folder.Type = (int)AssetType.Folder; + folder.Type = (int)FolderType.None; success = m_Connector.AddFolder(folder); Assert.IsTrue(success, "Failed to add Test Folder to inventory"); @@ -133,7 +133,7 @@ namespace Robust.Tests Assert.IsTrue(success, "Failed to add link to notecard to inventory"); // Add a link to the Objects folder in Test Folder - item.AssetID = m_Connector.GetFolderForType(m_userID, AssetType.Object).ID; // use item ID of Objects folder + item.AssetID = m_Connector.GetFolderForType(m_userID, FolderType.Object).ID; // use item ID of Objects folder item.ID = new UUID("50000000-0000-0000-0000-000000000005"); item.AssetType = (int)AssetType.LinkFolder; item.Folder = folder.ID; -- cgit v1.1 From 1fb2f0296fdaff56745daa1c1e8096cd8e25462b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 15 Aug 2015 02:46:41 +0200 Subject: Track selected objects per client --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d4f29c8..96bccd2 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -442,6 +442,8 @@ namespace OpenSim.Tests.Common.Mock get { return new IPEndPoint(IPAddress.Loopback, (ushort)m_circuitCode); } } + public List SelectedObjects {get; private set;} + /// /// Constructor /// -- cgit v1.1 From c53f732163b391e4bcd33c8acb917deb7598e0a8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 17 Aug 2015 21:46:30 +0200 Subject: Change the IScriptApi back to it's original form, removing XEngine specific additions that should not have been there in the first place. Sleeping and time measurement are now completely internal to XEngine --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 57be1da..d7a144c 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -264,5 +264,9 @@ namespace OpenSim.Tests.Common { PostedEvents.Clear(); } + + public void SleepScript(UUID itemID, int delay) + { + } } } -- cgit v1.1 From 0af2fafddf36009ffe470da106dc6d0ceb3ced10 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 19 Aug 2015 11:04:28 +0100 Subject: add missing regionExtent setup and Scene physicsscene configuration ( not exactly as core) --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 14 ++++++++------ OpenSim/Tests/Common/Mock/TestScene.cs | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 4cdfe98..d36e42e 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -138,8 +138,15 @@ namespace OpenSim.Tests.Common SceneCommunicationService scs = new SceneCommunicationService(); + PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); + physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); + Vector3 regionExtent = new Vector3(regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); + PhysicsScene physicsScene + = physicsPluginManager.GetPhysicsScene( + "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); + TestScene testScene = new TestScene( - regInfo, m_acm, scs, m_simDataService, m_estateDataService, configSource, null); + regInfo, m_acm, physicsScene, scs, m_simDataService, m_estateDataService, configSource, null); INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); @@ -184,11 +191,6 @@ namespace OpenSim.Tests.Common testScene.LandChannel = new TestLandChannel(testScene); testScene.LoadWorldMap(); - PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); - physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); - testScene.PhysicsScene - = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); - testScene.RegionInfo.EstateSettings = new EstateSettings(); testScene.LoginsEnabled = true; testScene.RegisterRegionWithGrid(); diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index a7e0dfb..53a311e 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -33,16 +33,17 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Physics.Manager; namespace OpenSim.Tests.Common.Mock { public class TestScene : Scene { public TestScene( - RegionInfo regInfo, AgentCircuitManager authen, + RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, sceneGridService, simDataService, estateDataService, + : base(regInfo, authen, physicsScene, sceneGridService, simDataService, estateDataService, config, simulatorVersion) { } -- cgit v1.1 From e3d82ad706db04d295a549543380b71b00848f7f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Aug 2015 04:08:30 +0100 Subject: delay terrain sending if land queue is 2 busy --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 96bccd2..5daca1e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -590,6 +590,11 @@ namespace OpenSim.Tests.Common.Mock } + public virtual bool CanSendLayerData() + { + return false; + } + public virtual void SendLayerData(float[] map) { } -- cgit v1.1 From 5648eb7bd1f2345aad1530d90964278fe352faea Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 30 Aug 2015 15:52:26 -0700 Subject: Moved instantiation of SceneCommunicationService object to inside the scene constructor. This was a left over from the original monolithic design of scene communications. The less the instantiators of scenes know about the scene's internals, the better. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 4 +--- OpenSim/Tests/Common/Mock/TestScene.cs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 1fb1c5c..4f685b6 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -148,8 +148,6 @@ namespace OpenSim.Tests.Common regInfo.RegionSizeX = sizeX; regInfo.RegionSizeY = sizeY; - SceneCommunicationService scs = new SceneCommunicationService(); - PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); @@ -158,7 +156,7 @@ namespace OpenSim.Tests.Common "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); TestScene testScene = new TestScene( - regInfo, m_acm, physicsScene, scs, SimDataService, m_estateDataService, configSource, null); + regInfo, m_acm, physicsScene, SimDataService, m_estateDataService, configSource, null); INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 45acf91..bd36097 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -42,9 +42,9 @@ namespace OpenSim.Tests.Common { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, - SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, + ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, physicsScene, sceneGridService, simDataService, estateDataService, + : base(regInfo, authen, physicsScene, simDataService, estateDataService, config, simulatorVersion) { } -- cgit v1.1 From 2c0cad6dd3014e9ad363090f5f7872c43daffcbd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 30 Aug 2015 20:29:31 -0700 Subject: Renamed the namespaces too --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 4f685b6..7ee4c94 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -36,7 +36,7 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Region.Physics.Manager; +using OpenSim.Region.PhysicsModule.SharedBase; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index bd36097..8a9e279 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -33,7 +33,7 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.Physics.Manager; +using OpenSim.Region.PhysicsModule.SharedBase; using OpenSim.Services.Interfaces; namespace OpenSim.Tests.Common -- cgit v1.1 From ce2c67876e0ebf4f84420696f660dc77d96dea6b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 30 Aug 2015 21:05:36 -0700 Subject: More namespace and dll name changes. Still no functional changes. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 7ee4c94..a26e844 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -36,7 +36,7 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Region.PhysicsModule.SharedBase; +using OpenSim.Region.PhysicsModules.SharedBase; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -149,7 +149,7 @@ namespace OpenSim.Tests.Common regInfo.RegionSizeY = sizeY; PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); - physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); + physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.PhysicsModule.BasicPhysics.dll"); Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); PhysicsScene physicsScene = physicsPluginManager.GetPhysicsScene( diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 8a9e279..08cfff2 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -33,7 +33,7 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.PhysicsModule.SharedBase; +using OpenSim.Region.PhysicsModules.SharedBase; using OpenSim.Services.Interfaces; namespace OpenSim.Tests.Common -- cgit v1.1 From 11194209df8a29f5103e6e34104eae7834f3280a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 31 Aug 2015 14:09:15 -0700 Subject: First commit where physics work as region module. Moved all physics dlls out of Physics and into bin directly, so they can be found by the module loader. Removed call to PhysicsPluginManager. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 5 +---- OpenSim/Tests/Common/Mock/TestScene.cs | 4 ++-- OpenSim/Tests/Common/OpenSimTestCase.cs | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index a26e844..27705bd 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -151,12 +151,9 @@ namespace OpenSim.Tests.Common PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.PhysicsModule.BasicPhysics.dll"); Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); - PhysicsScene physicsScene - = physicsPluginManager.GetPhysicsScene( - "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); TestScene testScene = new TestScene( - regInfo, m_acm, physicsScene, SimDataService, m_estateDataService, configSource, null); + regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 08cfff2..951f103 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -41,10 +41,10 @@ namespace OpenSim.Tests.Common public class TestScene : Scene { public TestScene( - RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, + RegionInfo regInfo, AgentCircuitManager authen, ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, physicsScene, simDataService, estateDataService, + : base(regInfo, authen, simDataService, estateDataService, config, simulatorVersion) { } diff --git a/OpenSim/Tests/Common/OpenSimTestCase.cs b/OpenSim/Tests/Common/OpenSimTestCase.cs index c1415af..9fea348 100644 --- a/OpenSim/Tests/Common/OpenSimTestCase.cs +++ b/OpenSim/Tests/Common/OpenSimTestCase.cs @@ -38,7 +38,7 @@ namespace OpenSim.Tests.Common [SetUp] public virtual void SetUp() { -// TestHelpers.InMethod(); + //TestHelpers.InMethod(); // Disable logging for each test so that one where logging is enabled doesn't cause all subsequent tests // to have logging on if it failed with an exception. TestHelpers.DisableLogging(); -- cgit v1.1 From 9435405ca1c173963dd6e97116a27b798a211801 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 31 Aug 2015 16:23:43 -0700 Subject: Deleted physics plugin classes. More unit tests fixed. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 27705bd..53509dc 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -48,6 +48,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence; +using OpenSim.Region.PhysicsModule.BasicPhysics; using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; @@ -77,6 +78,8 @@ namespace OpenSim.Tests.Common private CoreAssetCache m_cache; + private PhysicsScene m_physicsScene; + public SceneHelpers() : this(null) {} public SceneHelpers(CoreAssetCache cache) @@ -97,6 +100,8 @@ namespace OpenSim.Tests.Common m_cache = cache; + m_physicsScene = StartPhysicsScene(); + SimDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); } @@ -148,10 +153,6 @@ namespace OpenSim.Tests.Common regInfo.RegionSizeX = sizeX; regInfo.RegionSizeY = sizeY; - PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); - physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.PhysicsModule.BasicPhysics.dll"); - Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); - TestScene testScene = new TestScene( regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); @@ -159,6 +160,10 @@ namespace OpenSim.Tests.Common godsModule.Initialise(new IniConfigSource()); godsModule.AddRegion(testScene); + // Add scene to physics + ((INonSharedRegionModule)m_physicsScene).AddRegion(testScene); + ((INonSharedRegionModule)m_physicsScene).RegionLoaded(testScene); + // Add scene to services m_assetService.AddRegion(testScene); @@ -325,6 +330,19 @@ namespace OpenSim.Tests.Common return presenceService; } + private static PhysicsScene StartPhysicsScene() + { + IConfigSource config = new IniConfigSource(); + config.AddConfig("Startup"); + config.Configs["Startup"].Set("physics", "basicphysics"); + + PhysicsScene pScene = new BasicScene(); + INonSharedRegionModule mod = pScene as INonSharedRegionModule; + mod.Initialise(config); + + return pScene; + } + /// /// Setup modules for a scene using their default settings. /// -- cgit v1.1 From a11edceb00b5b86f825bd957bdac9edb91f893dd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 2 Sep 2015 19:54:53 +0100 Subject: seems to compile ( tests comented out) --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 13 ------------- OpenSim/Tests/Common/Mock/TestScene.cs | 3 --- 2 files changed, 16 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 9ed3eae..b368822 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -152,22 +152,13 @@ namespace OpenSim.Tests.Common PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); -<<<<<<< HEAD - Vector3 regionExtent = new Vector3( regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); - PhysicsScene physicsScene -======= Vector3 regionExtent = new Vector3(regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); PhysicsScene physicsScene ->>>>>>> avn/ubitvar = physicsPluginManager.GetPhysicsScene( "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); TestScene testScene = new TestScene( -<<<<<<< HEAD regInfo, m_acm, physicsScene, scs, SimDataService, m_estateDataService, configSource, null); -======= - regInfo, m_acm, physicsScene, scs, m_simDataService, m_estateDataService, configSource, null); ->>>>>>> avn/ubitvar INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); @@ -210,11 +201,7 @@ namespace OpenSim.Tests.Common testScene.SetModuleInterfaces(); testScene.LandChannel = new TestLandChannel(testScene); -<<<<<<< HEAD - testScene.LoadWorldMap(); -======= testScene.LoadWorldMap(); ->>>>>>> avn/ubitvar testScene.RegionInfo.EstateSettings = new EstateSettings(); testScene.LoginsEnabled = true; diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index e559871..45acf91 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -34,10 +34,7 @@ using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; -<<<<<<< HEAD using OpenSim.Services.Interfaces; -======= ->>>>>>> avn/ubitvar namespace OpenSim.Tests.Common { -- cgit v1.1 From d00f73c3a4cac77c97dcf4df1613fb85a516ffb4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 4 Sep 2015 14:39:23 -0700 Subject: Deleted OpenSim.Framework.Communications. Moved its two remaining files to OpenSim.Framework. --- OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs | 2 +- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 2 +- OpenSim/Tests/Performance/NPCPerformanceTests.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index cf7583e..b215f1e 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -37,7 +37,7 @@ using Nini.Config; using NUnit.Framework; using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Framework.Communications; + using OpenSim.Framework.Servers; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 53509dc..df8b14c 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -32,7 +32,7 @@ using Nini.Config; using OpenMetaverse; using OpenSim.Data.Null; using OpenSim.Framework; -using OpenSim.Framework.Communications; + using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; diff --git a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs index 2fbebc4..c62b58e 100644 --- a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs @@ -27,7 +27,7 @@ using System.Collections.Generic; using OpenMetaverse; -using OpenSim.Framework.Communications; + using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 951f103..1a93c9f 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -28,7 +28,7 @@ using System; using Nini.Config; using OpenSim.Framework; -using OpenSim.Framework.Communications; + using OpenSim.Framework.Servers; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; diff --git a/OpenSim/Tests/Performance/NPCPerformanceTests.cs b/OpenSim/Tests/Performance/NPCPerformanceTests.cs index e222dc2..ca6ae42 100644 --- a/OpenSim/Tests/Performance/NPCPerformanceTests.cs +++ b/OpenSim/Tests/Performance/NPCPerformanceTests.cs @@ -34,7 +34,7 @@ using Nini.Config; using NUnit.Framework; using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Framework.Communications; + using OpenSim.Region.CoreModules.Avatar.Attachments; using OpenSim.Region.CoreModules.Avatar.AvatarFactory; using OpenSim.Region.CoreModules.Framework.InventoryAccess; -- cgit v1.1 From 339f60e99064b23fdd4ae2608bc3bd7dbdaa8466 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 8 Sep 2015 18:45:53 +0100 Subject: more on compile.. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 9 --------- 1 file changed, 9 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 5cd5b88..9ab8d13 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -153,15 +153,6 @@ namespace OpenSim.Tests.Common regInfo.RegionSizeX = sizeX; regInfo.RegionSizeY = sizeY; - SceneCommunicationService scs = new SceneCommunicationService(); - - PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); - physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); - Vector3 regionExtent = new Vector3(regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ); - PhysicsScene physicsScene - = physicsPluginManager.GetPhysicsScene( - "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); - TestScene testScene = new TestScene( regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); -- cgit v1.1 From 18536b4be624ff5583186eacb40b495eefe1fa93 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 27 Sep 2015 06:36:26 +0100 Subject: add missing SendAgentGroupDataUpdate to llClientView --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f034443..76ee5c2 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1208,6 +1208,10 @@ namespace OpenSim.Tests.Common { } + public void SendAgentGroupDataUpdate(UUID avatarID, GroupMembershipData[] data) + { + } + public void SendJoinGroupReply(UUID groupID, bool success) { } -- cgit v1.1 From 6821ace3c6b6eb5a38e49f38ba3fd492eda15843 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 26 Oct 2015 21:56:02 +0000 Subject: add basic SendFindAgent() to lludp. Future use may require a list of pairs (X,Y). For now one pair is good enough. --- OpenSim/Tests/Common/Mock/TestClient.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 76ee5c2..ff7ba00 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -943,8 +943,13 @@ namespace OpenSim.Tests.Common ReceivedOnlineNotifications.AddRange(agentIDs); } - public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, - Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) + public void SendFindAgent(UUID HunterID, UUID PreyID, double GlobalX, double GlobalY) + { + } + + public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, + Quaternion SitOrientation, bool autopilot, + Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) { } -- cgit v1.1 From eab427e58bf88ba4dd458695c45ecdb0a7b239fa Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 17 Nov 2015 09:00:18 +0000 Subject: work around some 'tests' errors: UUID.Zero is a invalid ownerID - missing file --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 9ab8d13..bdf217c 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -606,7 +606,7 @@ namespace OpenSim.Tests.Common /// public static SceneObjectGroup AddSceneObject(Scene scene) { - return AddSceneObject(scene, "Test Object", UUID.Zero); + return AddSceneObject(scene, "Test Object", UUID.Random()); } /// -- cgit v1.1 From 43ca32150c1856f7b3768172fec2d06b8f5e5bef Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 9 Mar 2016 02:45:11 +0100 Subject: Plumb RezRestoreToWorld from the client (part done) --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ff7ba00..1d8e38f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -118,6 +118,7 @@ namespace OpenSim.Tests.Common public event SetAlwaysRun OnSetAlwaysRun; public event DeRezObject OnDeRezObject; + public event RezRestoreToWorld OnRezRestoreToWorld; public event Action OnRegionHandShakeReply; public event GenericCall1 OnRequestWearables; public event Action OnCompleteMovementToRegion; -- cgit v1.1 From 76ab1ed10c57d8f2190366d8a61f9c989afff3df Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 19 Jun 2016 16:27:12 -0700 Subject: Restored sending group membership data via EventQueue -- this had been a regression. Took the opportunity to refactor that code, so that both Groups V2 and XmlRpcGroups can use the same function. --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index f2bae58..332d59c 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -162,6 +162,11 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "GroupMembership", groupUpdate); } + public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) + { + AddEvent(receiverAgent, "AgentGroupDataUpdate", data); + } + public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono) { Console.WriteLine("ONE"); -- cgit v1.1 From 8d99fe095a231ba71ce71712cb87f8114672e7df Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 19 Jun 2016 17:35:11 -0700 Subject: Mantis #7920: group info was not being updated in many situations. (regression) Putting back the heavy messaging. --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 332d59c..192f84f 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -162,7 +162,7 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "GroupMembership", groupUpdate); } - public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) + public void GroupMembershipData(UUID receiverAgent, UUID dataForClientID, GroupMembershipData[] data) { AddEvent(receiverAgent, "AgentGroupDataUpdate", data); } -- cgit v1.1 From c34fcae3f32c7154ab93b4974991c959d4ad3955 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 24 Jun 2016 12:27:45 -0700 Subject: Added a test for checking permissions in inventory items that are transferred. This is a work in progress. All permission assertions are commented for now. Will get back to this later when permissions are fixed by Melanie. --- OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index 5a36332..e7e145a 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -128,6 +128,10 @@ namespace OpenSim.Tests.Common item.Owner = userId; item.AssetType = asset.Type; item.InvType = (int)itemType; + item.BasePermissions = (uint)OpenMetaverse.PermissionMask.All | + (uint)(Framework.PermissionMask.foldedMask | Framework.PermissionMask.foldedCopy | Framework.PermissionMask.foldedModify | Framework.PermissionMask.foldedTransfer); + item.CurrentPermissions = (uint)OpenMetaverse.PermissionMask.All | + (uint)(Framework.PermissionMask.foldedMask | Framework.PermissionMask.foldedCopy | Framework.PermissionMask.foldedModify | Framework.PermissionMask.foldedTransfer); InventoryFolderBase folder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, path)[0]; -- cgit v1.1 From 9358a6ad2979929655d0e25d404596772607f75b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 16:10:45 +0100 Subject: revert several changes to groups modules (agentGroupData is private). change interregions invite/eject messages, etc --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 192f84f..332d59c 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -162,7 +162,7 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "GroupMembership", groupUpdate); } - public void GroupMembershipData(UUID receiverAgent, UUID dataForClientID, GroupMembershipData[] data) + public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) { AddEvent(receiverAgent, "AgentGroupDataUpdate", data); } -- cgit v1.1 From aa744eecf2bc474509a1703028d681b27111ce84 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 18:19:09 +0100 Subject: add a few methods to modify clientview group powers --- OpenSim/Tests/Common/Mock/TestClient.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 1d8e38f..98a98c0 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1281,6 +1281,18 @@ namespace OpenSim.Tests.Common { } + public void UpdateGroupMembership(GroupMembershipData[] data) + { + } + + public void GroupMembershipRemove(UUID GroupID) + { + } + + public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) + { + } + public void SendUseCachedMuteList() { } -- cgit v1.1 From 3af437c8bcd8590295f7cf6927cde0bcff9fa3b7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 19:20:04 +0100 Subject: cleanup a bit --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 332d59c..6ed9a16 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -157,11 +157,6 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); } - public void GroupMembership (OpenMetaverse.Packets.AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) - { - AddEvent(avatarID, "GroupMembership", groupUpdate); - } - public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) { AddEvent(receiverAgent, "AgentGroupDataUpdate", data); -- cgit v1.1 From ea8f3c83bf96453e8223d918933d5708fa49a3cc Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 4 Jul 2016 03:35:48 +0100 Subject: Finally remove the requirement for an InventoryItem/FolderBase object to be passed into inventory queries. This makes the API more homogenous and also will more clearly show coding errors related to HG inventory where the .Owner field has a meaning for a query but wasn't always set. --- OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 0280b73..d5c7dcb 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -159,8 +159,7 @@ namespace Robust.Tests XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); // Prefetch Notecard 1, will be cached from here on - InventoryItemBase item = new InventoryItemBase(new UUID("10000000-0000-0000-0000-000000000001"), m_userID); - item = m_Connector.GetItem(item); + InventoryItemBase item = m_Connector.GetItem(m_userID, new UUID("10000000-0000-0000-0000-000000000001")); Assert.NotNull(item, "Failed to get Notecard 1"); Assert.AreEqual("Test Notecard 1", item.Name, "Wrong name for Notecard 1"); -- cgit v1.1 From c9bd6ff94b8691a31b1c8bbd87387af07df4482e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 15 Jul 2016 15:54:54 +0100 Subject: disable OSHttpTests that will collide with testing new http server changes --- OpenSim/Tests/Common/Mock/TestHttpClientContext.cs | 2 ++ OpenSim/Tests/Common/Mock/TestHttpRequest.cs | 2 ++ OpenSim/Tests/Common/Mock/TestHttpResponse.cs | 2 ++ 3 files changed, 6 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs index 5a55b09..be437dc 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs @@ -36,6 +36,7 @@ using OpenSim.Framework; namespace OpenSim.Tests.Common { +/* public class TestHttpClientContext: IHttpClientContext { /// @@ -107,4 +108,5 @@ namespace OpenSim.Tests.Common /// public event EventHandler RequestReceived = delegate { }; } +*/ } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs index b868895..d07287d 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs @@ -33,6 +33,7 @@ using HttpServer.FormDecoders; namespace OpenSim.Tests.Common { +/* public class TestHttpRequest: IHttpRequest { private string _uriPath; @@ -171,4 +172,5 @@ namespace OpenSim.Tests.Common } } } +*/ } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs index ff47c10..c344fb8 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs @@ -33,6 +33,7 @@ using HttpServer; namespace OpenSim.Tests.Common { +/* public class TestHttpResponse: IHttpResponse { public Stream Body @@ -168,4 +169,5 @@ namespace OpenSim.Tests.Common public void Redirect(Uri uri) {} public void Redirect(string url) {} } +*/ } \ No newline at end of file -- cgit v1.1 From cdf215f6130b88a0fce9b56075947b539f1043a7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 23 Jul 2016 01:28:47 +0100 Subject: add a missing field to ChatterBoxSessionAgentListUpdates. it is still wrong, and its use even worse --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 6ed9a16..417efce 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -147,9 +147,9 @@ namespace OpenSim.Tests.Common timeStamp, offline, parentEstateID, position, ttl, transactionID, fromGroup, binaryBucket); } - public void ChatterBoxSessionAgentListUpdates (UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, bool isModerator, bool textMute) + public void ChatterBoxSessionAgentListUpdates (UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, bool isModerator, bool textMute , bool isEnterorLeave) { - AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute); + AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute, isEnterorLeave); } public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) -- cgit v1.1 From e766f9d20f80425948f5cfe9204cdf85908e77fa Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 26 Jul 2016 16:54:04 +0100 Subject: get a copy of current clientView group powers --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 98a98c0..cc87a54 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -421,6 +421,11 @@ namespace OpenSim.Tests.Common return false; } + public Dictionary GetGroupPowers() + { + return new Dictionary(); + } + public ulong GetGroupPowers(UUID groupID) { return 0; -- cgit v1.1 From 13ae6dff18a507791b3e05eaef74c2f2066cdfec Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 26 Jul 2016 17:34:59 +0100 Subject: let some group related data to have a public set --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index cc87a54..83328c8 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -404,16 +404,19 @@ namespace OpenSim.Tests.Common public UUID ActiveGroupId { get { return UUID.Zero; } + set { } } public string ActiveGroupName { get { return String.Empty; } + set { } } public ulong ActiveGroupPowers { get { return 0; } + set { } } public bool IsGroupMember(UUID groupID) -- cgit v1.1 From 1a8a8e16efae4bdfc5cbd5108171737ceaaa4c67 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 26 Jul 2016 17:57:14 +0100 Subject: add a public SetGroupPowers to clientView --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 83328c8..4f8e986 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -429,6 +429,8 @@ namespace OpenSim.Tests.Common return new Dictionary(); } + public void SetGroupPowers(Dictionary powers) { } + public ulong GetGroupPowers(UUID groupID) { return 0; -- cgit v1.1 From 4599b3ecfdde9cf6e5d2b87da9824c114a9822a0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 30 Jul 2016 22:05:55 +0100 Subject: test jenkins for error line number --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index bdf217c..f8485e0 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -156,6 +156,9 @@ namespace OpenSim.Tests.Common TestScene testScene = new TestScene( regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); + testScene.RegionInfo.EstateSettings = new EstateSettings(); + testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); + INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); godsModule.AddRegion(testScene); @@ -197,13 +200,12 @@ namespace OpenSim.Tests.Common m_presenceService.RegionLoaded(testScene); testScene.AddRegionModule(m_presenceService.Name, m_presenceService); - testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); + testScene.SetModuleInterfaces(); testScene.LandChannel = new TestLandChannel(testScene); testScene.LoadWorldMap(); - - testScene.RegionInfo.EstateSettings = new EstateSettings(); + testScene.LoginsEnabled = true; testScene.RegisterRegionWithGrid(); -- cgit v1.1 From 9aa2484f0d33b8fcce2810bd36b70c9ceb61c2f5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 11 Aug 2016 08:38:39 +0100 Subject: to do that don't use slideexpiration; add cap event ChatterBoxForceClose --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 417efce..bc30945 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -152,6 +152,11 @@ namespace OpenSim.Tests.Common AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute, isEnterorLeave); } + public void ChatterBoxForceClose (UUID toAgent, UUID sessionID, string reason) + { + AddEvent(toAgent, "ForceCloseChatterBoxSession", sessionID, reason); + } + public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) { AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); -- cgit v1.1 From ac542715f1712eaba298a0a8e42c3ce9b0c7f24a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 18 Aug 2016 12:45:11 +0100 Subject: add caps HomeLocation ; add client SendAlertMessage(string message, string info), where info in info message field. only minimal testing done --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4f8e986..9b087c9 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -861,6 +861,10 @@ namespace OpenSim.Tests.Common { } + public void SendAlertMessage(string message, string info) + { + } + public void SendSystemAlertMessage(string message) { } -- cgit v1.1 From d5f376a4b10ffdb5acc17d4e350a0a523ba0e9f5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 25 Aug 2016 09:51:34 +0100 Subject: send selected objects Proprieties udp part outside update queues and as a physics single caps message per selection request --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 9b087c9..6a697f2 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1384,6 +1384,10 @@ namespace OpenSim.Tests.Common { } + public void SendSelectedPartsProprieties(List parts) + { + } + public void SendPartPhysicsProprieties(ISceneEntity entity) { } -- cgit v1.1 From 3f9f10529548599d1810ca8a630734586ed3fa9d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 17 Sep 2016 15:45:11 +0100 Subject: add to databases a table to store baked terrain. --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 3ab9020..61fee4b 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -74,6 +74,11 @@ namespace OpenSim.Data.Null m_store.StoreTerrain(terrain, regionID); } + public void StoreBakedTerrain(TerrainData terrain, UUID regionID) + { + m_store.StoreBakedTerrain(terrain, regionID); + } + public double[,] LoadTerrain(UUID regionID) { return m_store.LoadTerrain(regionID); @@ -170,6 +175,7 @@ namespace OpenSim.Data.Null protected Dictionary> m_primItems = new Dictionary>(); protected Dictionary m_terrains = new Dictionary(); + protected Dictionary m_bakedterrains = new Dictionary(); protected Dictionary m_landData = new Dictionary(); public void Initialise(string dbfile) @@ -319,6 +325,11 @@ namespace OpenSim.Data.Null m_terrains[regionID] = ter; } + public void StoreBakedTerrain(TerrainData ter, UUID regionID) + { + m_bakedterrains[regionID] = ter; + } + public void StoreTerrain(double[,] ter, UUID regionID) { m_terrains[regionID] = new HeightmapTerrainData(ter); -- cgit v1.1 From 71bd3ce49f1159251ec4339d098d93c2119729f0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 17 Sep 2016 16:42:40 +0100 Subject: add load baked terrain methods --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 61fee4b..8daa19d 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -89,6 +89,11 @@ namespace OpenSim.Data.Null return m_store.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); } + public TerrainData LoadBakedTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) + { + return m_store.LoadBakedTerrain(regionID, pSizeX, pSizeY, pSizeZ); + } + public void StoreLandObject(ILandObject Parcel) { m_store.StoreLandObject(Parcel); @@ -343,6 +348,14 @@ namespace OpenSim.Data.Null return null; } + public TerrainData LoadBakedTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) + { + if (m_bakedterrains.ContainsKey(regionID)) + return m_bakedterrains[regionID]; + else + return null; + } + public double[,] LoadTerrain(UUID regionID) { if (m_terrains.ContainsKey(regionID)) -- cgit v1.1 From a6df626868c9715288b2ef025efe18a015256a74 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 23 Sep 2016 13:03:16 +0100 Subject: add a version tag to wind and cloud data updates to iclient --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6a697f2..9251c4f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -659,9 +659,9 @@ namespace OpenSim.Tests.Common { } - public virtual void SendWindData(Vector2[] windSpeeds) { } + public virtual void SendWindData(int version, Vector2[] windSpeeds) { } - public virtual void SendCloudData(float[] cloudCover) { } + public virtual void SendCloudData(int version, float[] cloudCover) { } public virtual void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) { -- cgit v1.1 From 4ebb4e371f44e8e8e9612d8e5eaab274263a2f89 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 13 Nov 2016 19:25:32 +0000 Subject: prevent self call to llSetScriptState(ownname,FALSE) from blocking entire engine --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index d7a144c..b6f5760 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -221,7 +221,7 @@ namespace OpenSim.Tests.Common throw new System.NotImplementedException (); } - public void SetScriptState(UUID itemID, bool state) + public void SetScriptState(UUID itemID, bool state, bool self) { throw new System.NotImplementedException (); } -- cgit v1.1 From 1388ac2ef7d774b4d25f18d237fdad89d7ac43ac Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 12 Dec 2016 11:09:38 +0000 Subject: Rename charterMember to membershipType to show what it actually is. This field started out as a simple flag in the protocol to indicate a user being a SL charter member. It has since then taken on additional functionality that means that the name is no longer appropriate. --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 9251c4f..f407e5a 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -990,7 +990,7 @@ namespace OpenSim.Tests.Common { } - public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, + public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) { -- cgit v1.1 From 69776aa70ce662ccd0ad3d9f2ecefb86671bbcb3 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 13 Dec 2016 19:47:26 +0000 Subject: Remove the AllowAlternatePorts option. It wasn't implemented anyway. Instead, handle the port being 0 as "any port" and assign a random port for regions in that case. --- OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestLLUDPServer.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs index 33cd8a2..df9f6f2 100644 --- a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs @@ -86,10 +86,10 @@ namespace OpenSim.Tests.Common uint port = 0; AgentCircuitManager acm = scene.AuthenticateHandler; - TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, false, configSource, acm); + TestLLUDPServer udpServer = new TestLLUDPServer(IPAddress.Any, ref port, 0, configSource, acm); udpServer.AddScene(scene); return udpServer; } } -} \ No newline at end of file +} diff --git a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs index 26887c9..b2c6a8c 100644 --- a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs +++ b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs @@ -43,8 +43,8 @@ namespace OpenSim.Tests.Common { public List PacketsSent { get; private set; } - public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) - : base(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager) + public TestLLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager) + : base(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager) { PacketsSent = new List(); } -- cgit v1.1 From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- OpenSim/Tests/Clients/Grid/GridClient.cs | 8 +-- OpenSim/Tests/Common/DatabaseTestAttribute.cs | 6 +- OpenSim/Tests/Common/Helpers/AssetHelpers.cs | 32 ++++----- .../Common/Helpers/BaseRequestHandlerHelpers.cs | 2 +- OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs | 2 +- .../Tests/Common/Helpers/EntityTransferHelpers.cs | 10 +-- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 66 +++++++++--------- .../Tests/Common/Helpers/TaskInventoryHelpers.cs | 12 ++-- OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs | 4 +- .../Tests/Common/Helpers/UserInventoryHelpers.cs | 16 ++--- OpenSim/Tests/Common/LongRunningAttribute.cs | 4 +- OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 8 +-- .../Common/Mock/MockGroupsServicesConnector.cs | 28 ++++---- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 24 +++---- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 8 +-- OpenSim/Tests/Common/Mock/TestClient.cs | 22 +++--- .../Tests/Common/Mock/TestEventQueueGetModule.cs | 10 +-- OpenSim/Tests/Common/Mock/TestHttpClientContext.cs | 14 ++-- OpenSim/Tests/Common/Mock/TestHttpRequest.cs | 80 +++++++++++----------- OpenSim/Tests/Common/Mock/TestHttpResponse.cs | 36 +++++----- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 40 +++++------ OpenSim/Tests/Common/Mock/TestLLUDPServer.cs | 26 +++---- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- OpenSim/Tests/Common/Mock/TestScene.cs | 6 +- .../Tests/Common/Mock/TestXInventoryDataPlugin.cs | 10 +-- OpenSim/Tests/Common/TestHelpers.cs | 8 +-- OpenSim/Tests/Robust/Clients/Grid/GridClient.cs | 4 +- .../Robust/Clients/Inventory/InventoryClient.cs | 4 +- .../Tests/Stress/VectorRenderModuleStressTests.cs | 4 +- 29 files changed, 248 insertions(+), 248 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs index fed7a16..7d3aee3 100644 --- a/OpenSim/Tests/Clients/Grid/GridClient.cs +++ b/OpenSim/Tests/Clients/Grid/GridClient.cs @@ -47,7 +47,7 @@ namespace OpenSim.Tests.Clients.GridClient // private static readonly ILog m_log = // LogManager.GetLogger( // MethodBase.GetCurrentMethod().DeclaringType); - + public static void Main(string[] args) { ConsoleAppender consoleAppender = new ConsoleAppender(); @@ -62,7 +62,7 @@ namespace OpenSim.Tests.Clients.GridClient GridRegion r2 = CreateRegion("Test Region 2", 1001, 1000); GridRegion r3 = CreateRegion("Test Region 3", 1005, 1000); - Console.WriteLine("[GRID CLIENT]: *** Registering region 1"); + Console.WriteLine("[GRID CLIENT]: *** Registering region 1"); string msg = m_Connector.RegisterRegion(UUID.Zero, r1); if (msg == String.Empty) Console.WriteLine("[GRID CLIENT]: Successfully registered region 1"); @@ -149,7 +149,7 @@ namespace OpenSim.Tests.Clients.GridClient Console.WriteLine("[GRID CLIENT]: GetRegionsByName returned " + regions.Count + " regions"); Console.WriteLine("[GRID CLIENT]: *** GetRegionRange (this should return 2 regions)"); - regions = m_Connector.GetRegionRange(UUID.Zero, + regions = m_Connector.GetRegionRange(UUID.Zero, (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); if (regions == null) @@ -198,7 +198,7 @@ namespace OpenSim.Tests.Clients.GridClient region.ExternalHostName = "127.0.0.1"; region.HttpPort = 9000; region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); - + return region; } } diff --git a/OpenSim/Tests/Common/DatabaseTestAttribute.cs b/OpenSim/Tests/Common/DatabaseTestAttribute.cs index d027d59..d6a03cd 100644 --- a/OpenSim/Tests/Common/DatabaseTestAttribute.cs +++ b/OpenSim/Tests/Common/DatabaseTestAttribute.cs @@ -32,13 +32,13 @@ using NUnit.Framework; namespace OpenSim.Tests.Common { - [AttributeUsage(AttributeTargets.All, - AllowMultiple=false, + [AttributeUsage(AttributeTargets.All, + AllowMultiple=false, Inherited=true)] public class DatabaseTestAttribute : LongRunningAttribute { public DatabaseTestAttribute() : base("Database") - { + { } } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Helpers/AssetHelpers.cs b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs index 7af8bed..974da4c 100644 --- a/OpenSim/Tests/Common/Helpers/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/AssetHelpers.cs @@ -66,7 +66,7 @@ namespace OpenSim.Tests.Common { return CreateAsset(assetId, AssetType.Notecard, text, UUID.Random()); } - + // /// // /// Create and store a notecard asset with a random uuid and dummy text. // /// @@ -92,7 +92,7 @@ namespace OpenSim.Tests.Common { return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), sog); } - + /// /// Create an asset from the given object. /// @@ -102,12 +102,12 @@ namespace OpenSim.Tests.Common public static AssetBase CreateAsset(UUID assetUuid, SceneObjectGroup sog) { return CreateAsset( - assetUuid, - AssetType.Object, - Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)), + assetUuid, + AssetType.Object, + Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)), sog.OwnerID); } - + /// /// Create an asset from the given scene object. /// @@ -120,8 +120,8 @@ namespace OpenSim.Tests.Common public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa) { return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa); - } - + } + /// /// Create an asset from the given scene object. /// @@ -131,12 +131,12 @@ namespace OpenSim.Tests.Common public static AssetBase CreateAsset(UUID assetUuid, CoalescedSceneObjects coa) { return CreateAsset( - assetUuid, - AssetType.Object, - Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)), + assetUuid, + AssetType.Object, + Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)), coa.CreatorId); - } - + } + /// /// Create an asset from the given data. /// @@ -148,7 +148,7 @@ namespace OpenSim.Tests.Common return CreateAsset(assetUuid, assetType, anc.AssetData, creatorID); } - + /// /// Create an asset from the given data. /// @@ -158,9 +158,9 @@ namespace OpenSim.Tests.Common asset.Data = data; return asset; } - + public static string ReadAssetAsString(IAssetService assetService, UUID uuid) - { + { byte[] assetData = assetService.GetData(uuid.ToString()); return Encoding.ASCII.GetString(assetData); } diff --git a/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs index 82ecf9a..b27c719 100644 --- a/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/BaseRequestHandlerHelpers.cs @@ -59,7 +59,7 @@ namespace OpenSim.Tests.Common Assert.AreEqual(m_emptyStringArray, handler.SplitParams(null), "Failed on null."); Assert.AreEqual(m_emptyStringArray, handler.SplitParams(""), "Failed on empty path."); Assert.AreEqual(m_emptyStringArray, handler.SplitParams("corruptUrl"), "Failed on corrupt url."); - + Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath), "Failed on empty params."); Assert.AreEqual(m_emptyStringArray, handler.SplitParams(assetsPath + "/"), "Failed on single slash."); diff --git a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs index df9f6f2..753830f 100644 --- a/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/ClientStackHelpers.cs @@ -48,7 +48,7 @@ namespace OpenSim.Tests.Common { public static ScenePresence AddChildClient( Scene scene, LLUDPServer udpServer, UUID agentId, UUID sessionId, uint circuitCode) - { + { IPEndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999); UseCircuitCodePacket uccp = new UseCircuitCodePacket(); diff --git a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs index 1f6233d..b0c9596 100644 --- a/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/EntityTransferHelpers.cs @@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common /// /// /// - /// A list that will be populated with any TestClients set up in response to + /// A list that will be populated with any TestClients set up in response to /// being informed about a destination region. /// public static void SetupInformClientOfNeighbourTriggersNeighbourClientCreate( @@ -71,7 +71,7 @@ namespace OpenSim.Tests.Common Util.RegionHandleToRegionLoc(neighbourHandle, out x, out y); m_log.DebugFormat( - "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}", + "[TEST CLIENT]: Processing inform client of neighbour located at {0},{1} at {2}", x, y, neighbourExternalEndPoint); AgentCircuitData newAgent = tc.RequestClientInfo(); @@ -91,20 +91,20 @@ namespace OpenSim.Tests.Common /// /// /// - /// A list that will be populated with any TestClients set up in response to + /// A list that will be populated with any TestClients set up in response to /// being informed about a destination region. /// public static void SetupSendRegionTeleportTriggersDestinationClientCreateAndCompleteMovement( TestClient client, List destinationClients) { - client.OnTestClientSendRegionTeleport + client.OnTestClientSendRegionTeleport += (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL) => { uint x, y; Util.RegionHandleToRegionLoc(regionHandle, out x, out y); m_log.DebugFormat( - "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}", + "[TEST CLIENT]: Processing send region teleport for destination at {0},{1} at {2}", x, y, regionExternalEndPoint); AgentCircuitData newAgent = client.RequestClientInfo(); diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index f8485e0..fbd7e90 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -102,7 +102,7 @@ namespace OpenSim.Tests.Common m_physicsScene = StartPhysicsScene(); - SimDataService + SimDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); } @@ -146,7 +146,7 @@ namespace OpenSim.Tests.Common // We must set up a console otherwise setup of some modules may fail MainConsole.Instance = new MockConsole(); - + RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); regInfo.RegionName = name; regInfo.RegionID = id; @@ -199,13 +199,13 @@ namespace OpenSim.Tests.Common m_presenceService.AddRegion(testScene); m_presenceService.RegionLoaded(testScene); testScene.AddRegionModule(m_presenceService.Name, m_presenceService); - - + + testScene.SetModuleInterfaces(); testScene.LandChannel = new TestLandChannel(testScene); testScene.LoadWorldMap(); - + testScene.LoginsEnabled = true; testScene.RegisterRegionWithGrid(); @@ -217,10 +217,10 @@ namespace OpenSim.Tests.Common private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache) { IConfigSource config = new IniConfigSource(); - config.AddConfig("Modules"); - config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); config.AddConfig("AssetService"); - config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); + config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); @@ -235,7 +235,7 @@ namespace OpenSim.Tests.Common cache.Initialise(cacheConfig); } - + return assetService; } @@ -257,7 +257,7 @@ namespace OpenSim.Tests.Common private static LocalInventoryServicesConnector StartInventoryService() { - IConfigSource config = new IniConfigSource(); + IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("InventoryService"); config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); @@ -266,8 +266,8 @@ namespace OpenSim.Tests.Common LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); inventoryService.Initialise(config); - - return inventoryService; + + return inventoryService; } private static LocalGridServicesConnector StartGridService() @@ -282,7 +282,7 @@ namespace OpenSim.Tests.Common LocalGridServicesConnector gridService = new LocalGridServicesConnector(); gridService.Initialise(config); - + return gridService; } @@ -303,7 +303,7 @@ namespace OpenSim.Tests.Common LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector(); userAccountService.Initialise(config); - + return userAccountService; } @@ -328,7 +328,7 @@ namespace OpenSim.Tests.Common LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); presenceService.Initialise(config); - + return presenceService; } @@ -384,8 +384,8 @@ namespace OpenSim.Tests.Common ///
/// /// If called directly, then all the modules must be shared modules. - /// - /// We are emulating here the normal calls made to setup region modules + /// + /// We are emulating here the normal calls made to setup region modules /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()). /// TODO: Need to reuse normal runtime module code. /// @@ -655,7 +655,7 @@ namespace OpenSim.Tests.Common return so; } - + /// /// Create a scene object part. /// @@ -664,10 +664,10 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) - { + { return new SceneObjectPart( - ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) - { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; + ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; } /// @@ -682,10 +682,10 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId) - { + { return CreateSceneObject(parts, ownerId, 0x1); } - + /// /// Create a scene object but do not add it to the scene. /// @@ -697,10 +697,10 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail) - { + { return CreateSceneObject(parts, ownerId, "", uuidTail); - } - + } + /// /// Create a scene object but do not add it to the scene. /// @@ -718,22 +718,22 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail) - { + { string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail); - - SceneObjectGroup sog + + SceneObjectGroup sog = new SceneObjectGroup( CreateSceneObjectPart(string.Format("{0}Part1", partNamePrefix), new UUID(rawSogId), ownerId)); - + if (parts > 1) for (int i = 2; i <= parts; i++) sog.AddPart( CreateSceneObjectPart( - string.Format("{0}Part{1}", partNamePrefix, i), + string.Format("{0}Part{1}", partNamePrefix, i), new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i - 1)), ownerId)); - + return sog; - } + } } } diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs index 3a3b33a..e3110f6 100644 --- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs @@ -78,12 +78,12 @@ namespace OpenSim.Tests.Common = AssetHelpers.CreateAsset(assetID, AssetType.Notecard, nc.AssetData, UUID.Zero); assetService.Store(ncAsset); - TaskInventoryItem ncItem - = new TaskInventoryItem + TaskInventoryItem ncItem + = new TaskInventoryItem { Name = itemName, AssetID = assetID, ItemID = itemID, Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard }; - part.Inventory.AddInventoryItem(ncItem, true); - + part.Inventory.AddInventoryItem(ncItem, true); + return ncItem; } @@ -119,7 +119,7 @@ namespace OpenSim.Tests.Common { return AddScript(assetService, part, UUID.Random(), UUID.Random(), scriptName, scriptSource); } - + /// /// Add a simple script to the given part. /// @@ -145,7 +145,7 @@ namespace OpenSim.Tests.Common = AssetHelpers.CreateAsset(assetId, AssetType.LSLText, ast.AssetData, UUID.Zero); assetService.Store(asset); TaskInventoryItem item - = new TaskInventoryItem + = new TaskInventoryItem { Name = scriptName, AssetID = assetId, ItemID = itemId, Type = (int)AssetType.LSLText, InvType = (int)InventoryType.LSL }; part.Inventory.AddInventoryItem(item, true); diff --git a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs index c62b58e..e6af34b 100644 --- a/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserAccountHelpers.cs @@ -83,7 +83,7 @@ namespace OpenSim.Tests.Common // /// // /// // public static CachedUserInfo CreateUserWithInventory( -// CommunicationsManager commsManager, string firstName, string lastName, +// CommunicationsManager commsManager, string firstName, string lastName, // UUID userId, OnInventoryReceivedDelegate callback) // { // return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback); @@ -147,7 +147,7 @@ namespace OpenSim.Tests.Common CreateUserWithInventory(scene, ua, pw); return ua; } - + public static void CreateUserWithInventory(Scene scene, UserAccount ua, string pw) { // FIXME: This should really be set up by UserAccount itself diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index e7e145a..5a46201 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -101,7 +101,7 @@ namespace OpenSim.Tests.Common Scene scene, string itemName, UUID itemId, InventoryType itemType, AssetBase asset, UUID userId) { return AddInventoryItem( - scene, itemName, itemId, itemType, asset, userId, + scene, itemName, itemId, itemType, asset, userId, scene.InventoryService.GetFolderForType(userId, (FolderType)asset.Type).Name); } @@ -128,7 +128,7 @@ namespace OpenSim.Tests.Common item.Owner = userId; item.AssetType = asset.Type; item.InvType = (int)itemType; - item.BasePermissions = (uint)OpenMetaverse.PermissionMask.All | + item.BasePermissions = (uint)OpenMetaverse.PermissionMask.All | (uint)(Framework.PermissionMask.foldedMask | Framework.PermissionMask.foldedCopy | Framework.PermissionMask.foldedModify | Framework.PermissionMask.foldedTransfer); item.CurrentPermissions = (uint)OpenMetaverse.PermissionMask.All | (uint)(Framework.PermissionMask.foldedMask | Framework.PermissionMask.foldedCopy | Framework.PermissionMask.foldedModify | Framework.PermissionMask.foldedTransfer); @@ -211,7 +211,7 @@ namespace OpenSim.Tests.Common /// /// /// If true, then folders in the path which already the same name are - /// used. This applies to the terminal folder as well. + /// used. This applies to the terminal folder as well. /// If false, then all folders in the path are created, even if there is already a folder at a particular /// level with the same name. /// @@ -236,7 +236,7 @@ namespace OpenSim.Tests.Common /// /// /// If true, then folders in the path which already the same name are - /// used. This applies to the terminal folder as well. + /// used. This applies to the terminal folder as well. /// If false, then all folders in the path are created, even if there is already a folder at a particular /// level with the same name. /// @@ -259,7 +259,7 @@ namespace OpenSim.Tests.Common /// Create inventory folders starting from a given parent folder /// /// - /// If any stem of the path names folders that already exist then these are not recreated. This includes the + /// If any stem of the path names folders that already exist then these are not recreated. This includes the /// final folder. /// TODO: May need to make it an option to create duplicate folders. /// @@ -271,7 +271,7 @@ namespace OpenSim.Tests.Common /// /// /// If true, then folders in the path which already the same name are - /// used. This applies to the terminal folder as well. + /// used. This applies to the terminal folder as well. /// If false, then all folders in the path are created, even if there is already a folder at a particular /// level with the same name. /// @@ -299,10 +299,10 @@ namespace OpenSim.Tests.Common else folderIdForCreate = folderId; - folder + folder = new InventoryFolderBase( folderIdForCreate, components[0], parentFolder.Owner, (short)AssetType.Unknown, parentFolder.ID, 0); - + inventoryService.AddFolder(folder); } // else diff --git a/OpenSim/Tests/Common/LongRunningAttribute.cs b/OpenSim/Tests/Common/LongRunningAttribute.cs index 9831ea8..6013fcb 100644 --- a/OpenSim/Tests/Common/LongRunningAttribute.cs +++ b/OpenSim/Tests/Common/LongRunningAttribute.cs @@ -35,11 +35,11 @@ namespace OpenSim.Tests.Common [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] - public class LongRunningAttribute : CategoryAttribute + public class LongRunningAttribute : CategoryAttribute { public LongRunningAttribute() : this("Long Running Test") { - + } protected LongRunningAttribute(string category) : base(category) diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs index cb4fb80..d0430ff 100644 --- a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs @@ -36,7 +36,7 @@ namespace OpenSim.Tests.Common { protected Dictionary Assets = new Dictionary(); - public AssetBase FetchAsset(UUID uuid) + public AssetBase FetchAsset(UUID uuid) { if (AssetsExist(new[] { uuid })[0]) return Assets[uuid]; @@ -44,17 +44,17 @@ namespace OpenSim.Tests.Common return null; } - public void CreateAsset(AssetBase asset) + public void CreateAsset(AssetBase asset) { Assets[asset.FullID] = asset; } - public void UpdateAsset(AssetBase asset) + public void UpdateAsset(AssetBase asset) { CreateAsset(asset); } - public bool[] AssetsExist(UUID[] uuids) + public bool[] AssetsExist(UUID[] uuids) { return Array.ConvertAll(uuids, id => Assets.ContainsKey(id)); } diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index 7f530d0..e9deac7 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -85,8 +85,8 @@ namespace OpenSim.Tests.Common { } - public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, - int membershipFee, bool openEnrollment, bool allowPublish, + public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, + int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID) { XGroup group = new XGroup() @@ -118,13 +118,13 @@ namespace OpenSim.Tests.Common } } - public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, - UUID insigniaID, int membershipFee, bool openEnrollment, + public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, + UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish) { } - public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers) { } @@ -133,7 +133,7 @@ namespace OpenSim.Tests.Common { } - public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers) { } @@ -144,7 +144,7 @@ namespace OpenSim.Tests.Common if (group == null) - m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: No group found with ID {0}", groupID); + m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: No group found with ID {0}", groupID); return group; } @@ -152,7 +152,7 @@ namespace OpenSim.Tests.Common public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName) { m_log.DebugFormat( - "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", + "[MOCK GROUPS SERVICES CONNECTOR]: Processing GetGroupRecord() for groupID {0}, name {1}", groupID, groupName); XGroup xg = GetXGroup(groupID, groupName); @@ -194,7 +194,7 @@ namespace OpenSim.Tests.Common public void SetAgentGroupInfo(UUID requestingAgentID, UUID agentID, UUID groupID, bool acceptNotices, bool listInProfile) { m_log.DebugFormat( - "[MOCK GROUPS SERVICES CONNECTOR]: SetAgentGroupInfo, requestingAgentID {0}, agentID {1}, groupID {2}, acceptNotices {3}, listInProfile {4}", + "[MOCK GROUPS SERVICES CONNECTOR]: SetAgentGroupInfo, requestingAgentID {0}, agentID {1}, groupID {2}, acceptNotices {3}, listInProfile {4}", requestingAgentID, agentID, groupID, acceptNotices, listInProfile); XGroup group = GetXGroup(groupID, null); @@ -228,7 +228,7 @@ namespace OpenSim.Tests.Common public void AddAgentToGroup(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID) { m_log.DebugFormat( - "[MOCK GROUPS SERVICES CONNECTOR]: AddAgentToGroup, requestingAgentID {0}, agentID {1}, groupID {2}, roleID {3}", + "[MOCK GROUPS SERVICES CONNECTOR]: AddAgentToGroup, requestingAgentID {0}, agentID {1}, groupID {2}, roleID {3}", requestingAgentID, agentID, groupID, roleID); XGroup group = GetXGroup(groupID, null); @@ -348,7 +348,7 @@ namespace OpenSim.Tests.Common return notices; } - + public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) { m_log.DebugFormat( @@ -378,14 +378,14 @@ namespace OpenSim.Tests.Common return gni; } } - + return null; } - + public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) { m_log.DebugFormat( - "[MOCK GROUPS SERVICES CONNECTOR]: AddGroupNotice, requestingAgentID {0}, groupID {1}, noticeID {2}, fromName {3}, subject {4}, message {5}, binaryBucket.Length {6}", + "[MOCK GROUPS SERVICES CONNECTOR]: AddGroupNotice, requestingAgentID {0}, groupID {1}, noticeID {2}, fromName {3}, subject {4}, message {5}, binaryBucket.Length {6}", requestingAgentID, groupID, noticeID, fromName, subject, message, binaryBucket.Length); XGroup group = GetXGroup(groupID, null); diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 8daa19d..a73a0b8 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -174,15 +174,15 @@ namespace OpenSim.Data.Null public class NullDataStore : ISimulationDataStore { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected Dictionary m_regionSettings = new Dictionary(); protected Dictionary m_sceneObjectParts = new Dictionary(); - protected Dictionary> m_primItems + protected Dictionary> m_primItems = new Dictionary>(); protected Dictionary m_terrains = new Dictionary(); protected Dictionary m_bakedterrains = new Dictionary(); protected Dictionary m_landData = new Dictionary(); - + public void Initialise(string dbfile) { return; @@ -196,14 +196,14 @@ namespace OpenSim.Data.Null { m_regionSettings[rs.RegionUUID] = rs; } - + public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) { //This connector doesn't support the windlight module yet //Return default LL windlight settings return new RegionLightShareData(); } - + public void RemoveRegionWindlightSettings(UUID regionID) { } @@ -238,7 +238,7 @@ namespace OpenSim.Data.Null if (rs == null) rs = new RegionSettings(); - + return rs; } @@ -250,9 +250,9 @@ namespace OpenSim.Data.Null foreach (SceneObjectPart prim in obj.Parts) { // m_log.DebugFormat( -// "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", +// "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", // prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); - + m_sceneObjectParts[prim.UUID] = prim; } } @@ -266,7 +266,7 @@ namespace OpenSim.Data.Null if (part.ParentGroup.UUID == obj) { // m_log.DebugFormat( -// "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", +// "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", // part.Name, part.UUID, obj, regionUUID); m_sceneObjectParts.Remove(part.UUID); } @@ -281,7 +281,7 @@ namespace OpenSim.Data.Null public List LoadObjects(UUID regionUUID) { Dictionary objects = new Dictionary(); - + // Create all of the SOGs from the root prims first foreach (SceneObjectPart prim in m_sceneObjectParts.Values) { @@ -318,10 +318,10 @@ namespace OpenSim.Data.Null } } } - + // TODO: Load items. This is assymetric - we store items as a separate method but don't retrieve them that // way! - + return new List(objects.Values); } diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index b6f5760..9d426f6 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -40,7 +40,7 @@ using OpenSim.Region.ScriptEngine.Shared; namespace OpenSim.Tests.Common { public class MockScriptEngine : INonSharedRegionModule, IScriptModule, IScriptEngine - { + { public IConfigSource ConfigSource { get; private set; } public IConfig Config { get; private set; } @@ -89,7 +89,7 @@ namespace OpenSim.Tests.Common { } - public string Name { get { return "Mock Script Engine"; } } + public string Name { get { return "Mock Script Engine"; } } public string ScriptEngineName { get { return Name; } } public Type ReplaceableInterface { get { return null; } } @@ -200,7 +200,7 @@ namespace OpenSim.Tests.Common { throw new System.NotImplementedException (); } - + public IScriptWorkItem QueueEventHandler(object parms) { throw new System.NotImplementedException (); @@ -258,7 +258,7 @@ namespace OpenSim.Tests.Common public string[] ScriptReferencedAssemblies { get { throw new System.NotImplementedException (); } } - public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } + public ParameterInfo[] ScriptBaseClassParameters { get { throw new System.NotImplementedException (); } } public void ClearPostedEvents() { diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index f407e5a..e2f57b5 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -321,7 +321,7 @@ namespace OpenSim.Tests.Common public event AvatarInterestUpdate OnAvatarInterestUpdate; public event PlacesQuery OnPlacesQuery; - + public event FindAgentUpdate OnFindAgent; public event TrackAgentUpdate OnTrackAgent; public event NewUserReport OnUserReport; @@ -673,7 +673,7 @@ namespace OpenSim.Tests.Common { AgentCircuitData agentData = new AgentCircuitData(); agentData.AgentID = AgentId; - agentData.SessionID = SessionId; + agentData.SessionID = SessionId; agentData.SecureSessionID = UUID.Zero; agentData.circuitcode = m_circuitCode; agentData.child = false; @@ -713,7 +713,7 @@ namespace OpenSim.Tests.Common public virtual void SendTeleportFailed(string reason) { m_log.DebugFormat( - "[TEST CLIENT]: Teleport failed for {0} {1} on {2} with reason {3}", + "[TEST CLIENT]: Teleport failed for {0} {1} on {2} with reason {3}", m_firstName, m_lastName, m_scene.Name, reason); } @@ -781,7 +781,7 @@ namespace OpenSim.Tests.Common public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, - int version, + int version, bool fetchFolders, bool fetchItems) { @@ -881,7 +881,7 @@ namespace OpenSim.Tests.Common OnRegionHandShakeReply(this); } } - + public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) { } @@ -1314,7 +1314,7 @@ namespace OpenSim.Tests.Common public void SendMuteListUpdate(string filename) { } - + public void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled) { } @@ -1334,7 +1334,7 @@ namespace OpenSim.Tests.Common { } - public void Disconnect() + public void Disconnect() { } @@ -1343,19 +1343,19 @@ namespace OpenSim.Tests.Common if (OnReceivedSendRebakeAvatarTextures != null) OnReceivedSendRebakeAvatarTextures(textureID); } - + public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) { } - + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) { } - + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) { } - + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) { } diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index bc30945..3e00d82 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -46,7 +46,7 @@ namespace OpenSim.Tests.Common { public class TestEventQueueGetModule : IEventQueue, INonSharedRegionModule { - public class Event + public class Event { public string Name { get; set; } public object[] Args { get; set; } @@ -64,7 +64,7 @@ namespace OpenSim.Tests.Common public void Close() {} - public void AddRegion(Scene scene) + public void AddRegion(Scene scene) { Events = new Dictionary>(); scene.RegisterModuleInterface(this); @@ -138,12 +138,12 @@ namespace OpenSim.Tests.Common } public void ChatterboxInvitation( - UUID sessionID, string sessionName, UUID fromAgent, string message, UUID toAgent, string fromName, - byte dialog, uint timeStamp, bool offline, int parentEstateID, Vector3 position, uint ttl, + UUID sessionID, string sessionName, UUID fromAgent, string message, UUID toAgent, string fromName, + byte dialog, uint timeStamp, bool offline, int parentEstateID, Vector3 position, uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket) { AddEvent( - toAgent, "ChatterboxInvitation", sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog, + toAgent, "ChatterboxInvitation", sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog, timeStamp, offline, parentEstateID, position, ttl, transactionID, fromGroup, binaryBucket); } diff --git a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs index be437dc..7b20b8c 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpClientContext.cs @@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common /// Bodies of responses from the server. ///
public string ResponseBody - { + { get { return Encoding.UTF8.GetString(m_responseStream.ToArray()); } } @@ -56,8 +56,8 @@ namespace OpenSim.Tests.Common public bool IsSecured { get; set; } - public bool Secured - { + public bool Secured + { get { return IsSecured; } set { IsSecured = value; } } @@ -67,7 +67,7 @@ namespace OpenSim.Tests.Common Secured = secured; } - public void Disconnect(SocketError error) + public void Disconnect(SocketError error) { // Console.WriteLine("TestHttpClientContext.Disconnect Received disconnect with status {0}", error); } @@ -76,18 +76,18 @@ namespace OpenSim.Tests.Common public void Respond(string httpVersion, HttpStatusCode statusCode, string reason) {Console.WriteLine("xx");} public void Respond(string body) { Console.WriteLine("xxx");} - public void Send(byte[] buffer) + public void Send(byte[] buffer) { // Getting header data here // Console.WriteLine("xxxx: Got {0}", Encoding.UTF8.GetString(buffer)); } - public void Send(byte[] buffer, int offset, int size) + public void Send(byte[] buffer, int offset, int size) { // Util.PrintCallStack(); // // Console.WriteLine( -// "TestHttpClientContext.Send(byte[], int, int) got offset={0}, size={1}, buffer={2}", +// "TestHttpClientContext.Send(byte[], int, int) got offset={0}, size={1}, buffer={2}", // offset, size, Encoding.UTF8.GetString(buffer)); m_responseStream.Write(buffer, offset, size); diff --git a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs index d07287d..4c5ea4a 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpRequest.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpRequest.cs @@ -37,85 +37,85 @@ namespace OpenSim.Tests.Common public class TestHttpRequest: IHttpRequest { private string _uriPath; - public bool BodyIsComplete - { - get { return true; } + public bool BodyIsComplete + { + get { return true; } } - public string[] AcceptTypes - { + public string[] AcceptTypes + { get {return _acceptTypes; } } private string[] _acceptTypes; - public Stream Body - { - get { return _body; } - set { _body = value;} + public Stream Body + { + get { return _body; } + set { _body = value;} } private Stream _body; - public ConnectionType Connection - { + public ConnectionType Connection + { get { return _connection; } set { _connection = value; } } private ConnectionType _connection; - public int ContentLength - { + public int ContentLength + { get { return _contentLength; } set { _contentLength = value; } } private int _contentLength; - public NameValueCollection Headers - { + public NameValueCollection Headers + { get { return _headers; } } private NameValueCollection _headers = new NameValueCollection(); public string HttpVersion { get; set; } - public string Method - { + public string Method + { get { return _method; } set { _method = value; } } private string _method = null; - public HttpInput QueryString - { + public HttpInput QueryString + { get { return _queryString; } } private HttpInput _queryString = null; - public Uri Uri - { + public Uri Uri + { get { return _uri; } - set { _uri = value; } + set { _uri = value; } } private Uri _uri = null; - public string[] UriParts - { + public string[] UriParts + { get { return _uri.Segments; } } - public HttpParam Param - { - get { return null; } + public HttpParam Param + { + get { return null; } } - public HttpForm Form - { - get { return null; } + public HttpForm Form + { + get { return null; } } - public bool IsAjax - { - get { return false; } + public bool IsAjax + { + get { return false; } } - public RequestCookies Cookies - { - get { return null; } + public RequestCookies Cookies + { + get { return null; } } - public TestHttpRequest() + public TestHttpRequest() { HttpVersion = "HTTP/1.1"; } - public TestHttpRequest(string contentEncoding, string contentType, string userAgent, + public TestHttpRequest(string contentEncoding, string contentType, string userAgent, string remoteAddr, string remotePort, string[] acceptTypes, ConnectionType connectionType, int contentLength, Uri uri) : base() { @@ -137,7 +137,7 @@ namespace OpenSim.Tests.Common { _headers.Add(name, value); } - public int AddToBody(byte[] bytes, int offset, int length) + public int AddToBody(byte[] bytes, int offset, int length) { return 0; } @@ -168,7 +168,7 @@ namespace OpenSim.Tests.Common set { _uriPath = value; - + } } } diff --git a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs index c344fb8..190f6d5 100644 --- a/OpenSim/Tests/Common/Mock/TestHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestHttpResponse.cs @@ -36,7 +36,7 @@ namespace OpenSim.Tests.Common /* public class TestHttpResponse: IHttpResponse { - public Stream Body + public Stream Body { get { return _body; } @@ -44,14 +44,14 @@ namespace OpenSim.Tests.Common } private Stream _body; - public string ProtocolVersion - { + public string ProtocolVersion + { get { return _protocolVersion; } set { _protocolVersion = value; } } private string _protocolVersion; - public bool Chunked + public bool Chunked { get { return _chunked; } @@ -59,7 +59,7 @@ namespace OpenSim.Tests.Common } private bool _chunked; - public ConnectionType Connection + public ConnectionType Connection { get { return _connection; } @@ -67,7 +67,7 @@ namespace OpenSim.Tests.Common } private ConnectionType _connection; - public Encoding Encoding + public Encoding Encoding { get { return _encoding; } @@ -75,7 +75,7 @@ namespace OpenSim.Tests.Common } private Encoding _encoding; - public int KeepAlive + public int KeepAlive { get { return _keepAlive; } @@ -83,7 +83,7 @@ namespace OpenSim.Tests.Common } private int _keepAlive; - public HttpStatusCode Status + public HttpStatusCode Status { get { return _status; } @@ -91,7 +91,7 @@ namespace OpenSim.Tests.Common } private HttpStatusCode _status; - public string Reason + public string Reason { get { return _reason; } @@ -99,7 +99,7 @@ namespace OpenSim.Tests.Common } private string _reason; - public long ContentLength + public long ContentLength { get { return _contentLength; } @@ -107,7 +107,7 @@ namespace OpenSim.Tests.Common } private long _contentLength; - public string ContentType + public string ContentType { get { return _contentType; } @@ -115,19 +115,19 @@ namespace OpenSim.Tests.Common } private string _contentType; - public bool HeadersSent + public bool HeadersSent { get { return _headersSent; } } private bool _headersSent; - public bool Sent + public bool Sent { get { return _sent; } } private bool _sent; - public ResponseCookies Cookies + public ResponseCookies Cookies { get { return _cookies; } } @@ -141,26 +141,26 @@ namespace OpenSim.Tests.Common public void AddHeader(string name, string value) {} - public void Send() + public void Send() { if (!_headersSent) SendHeaders(); if (_sent) throw new InvalidOperationException("stuff already sent"); _sent = true; } - public void SendBody(byte[] buffer, int offset, int count) + public void SendBody(byte[] buffer, int offset, int count) { if (!_headersSent) SendHeaders(); _sent = true; } - public void SendBody(byte[] buffer) + public void SendBody(byte[] buffer) { if (!_headersSent) SendHeaders(); _sent = true; } - public void SendHeaders() + public void SendHeaders() { if (_headersSent) throw new InvalidOperationException("headers already sent"); _headersSent = true; diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index c97a765..0ff6f7f 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common public class TestInventoryDataPlugin : IInventoryDataPlugin { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// Inventory folders /// @@ -85,9 +85,9 @@ namespace OpenSim.Tests.Common public List getInventoryInFolder(UUID folderID) { // InventoryFolderBase folder = m_folders[folderID]; - + // m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); - + List items = new List(); foreach (InventoryItemBase item in m_items.Values) @@ -98,7 +98,7 @@ namespace OpenSim.Tests.Common items.Add(item); } } - + return items; } @@ -107,7 +107,7 @@ namespace OpenSim.Tests.Common public InventoryFolderBase getUserRootFolder(UUID user) { // m_log.DebugFormat("[MOCK INV DB]: Looking for root folder for {0}", user); - + InventoryFolderBase folder = null; m_rootFolders.TryGetValue(user, out folder); @@ -117,9 +117,9 @@ namespace OpenSim.Tests.Common public List getInventoryFolders(UUID parentID) { // InventoryFolderBase parentFolder = m_folders[parentID]; - + // m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); - + List folders = new List(); foreach (InventoryFolderBase folder in m_folders.Values) @@ -127,9 +127,9 @@ namespace OpenSim.Tests.Common if (folder.ParentID == parentID) { // m_log.DebugFormat( -// "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", +// "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", // folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); - + folders.Add(folder); } } @@ -153,9 +153,9 @@ namespace OpenSim.Tests.Common public void addInventoryFolder(InventoryFolderBase folder) { // m_log.DebugFormat( -// "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", +// "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", // folder.Name, folder.ID, (AssetType)folder.Type); - + m_folders[folder.ID] = folder; if (folder.ParentID == UUID.Zero) @@ -183,30 +183,30 @@ namespace OpenSim.Tests.Common m_folders.Remove(folderId); } - public void addInventoryItem(InventoryItemBase item) + public void addInventoryItem(InventoryItemBase item) { InventoryFolderBase folder = m_folders[item.Folder]; - + // m_log.DebugFormat( // "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); - + m_items[item.ID] = item; } - + public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } - - public void deleteInventoryItem(UUID itemId) + + public void deleteInventoryItem(UUID itemId) { if (m_items.ContainsKey(itemId)) m_items.Remove(itemId); } - - public InventoryItemBase getInventoryItem(UUID itemId) + + public InventoryItemBase getInventoryItem(UUID itemId) { if (m_items.ContainsKey(itemId)) return m_items[itemId]; else - return null; + return null; } public InventoryItemBase queryInventoryItem(UUID item) diff --git a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs index b2c6a8c..388b56b 100644 --- a/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs +++ b/OpenSim/Tests/Common/Mock/TestLLUDPServer.cs @@ -73,7 +73,7 @@ namespace OpenSim.Tests.Common //// /// The chunks of data to pass to the LLUDPServer when it calls EndReceive //// ///
//// protected Queue m_chunksToLoad = new Queue(); -// +// //// protected override void BeginReceive() //// { //// if (m_chunksToLoad.Count > 0 && m_chunksToLoad.Peek().BeginReceiveException) @@ -83,29 +83,29 @@ namespace OpenSim.Tests.Common //// throw new SocketException(); //// } //// } -// +// //// protected override bool EndReceive(out int numBytes, IAsyncResult result, ref EndPoint epSender) //// { //// numBytes = 0; //// //// //m_log.Debug("Queue size " + m_chunksToLoad.Count); -//// +//// //// if (m_chunksToLoad.Count <= 0) //// return false; -//// +//// //// ChunkSenderTuple tuple = m_chunksToLoad.Dequeue(); //// RecvBuffer = tuple.Data; //// numBytes = tuple.Data.Length; //// epSender = tuple.Sender; -//// +//// //// return true; //// } -// +// //// public override void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode) //// { //// // Don't do anything just yet //// } -// +// // /// // /// Signal that this chunk should throw an exception on Socket.BeginReceive() // /// @@ -116,7 +116,7 @@ namespace OpenSim.Tests.Common // tuple.BeginReceiveException = true; // m_chunksToLoad.Enqueue(tuple); // } -// +// // /// // /// Load some data to be received by the LLUDPServer on the next receive call // /// @@ -126,7 +126,7 @@ namespace OpenSim.Tests.Common // { // m_chunksToLoad.Enqueue(new ChunkSenderTuple(data, epSender)); // } -// +// // /// // /// Load a packet to be received by the LLUDPServer on the next receive call // /// @@ -135,7 +135,7 @@ namespace OpenSim.Tests.Common // { // LoadReceive(packet.ToBytes(), epSender); // } -// +// // /// // /// Calls the protected asynchronous result method. This fires out all data chunks currently queued for send // /// @@ -147,7 +147,7 @@ namespace OpenSim.Tests.Common //// OnReceivedData(result); // } } - + /// /// Record the data and sender tuple /// @@ -156,13 +156,13 @@ namespace OpenSim.Tests.Common public byte[] Data; public EndPoint Sender; public bool BeginReceiveException; - + public ChunkSenderTuple(byte[] data, EndPoint sender) { Data = data; Sender = sender; } - + public ChunkSenderTuple(EndPoint sender) { Sender = sender; diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 23258ad..3d44a33 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -65,7 +65,7 @@ namespace OpenSim.Tests.Common { return m_parcels; } - + public void Clear(bool setupDefaultParcel) { m_parcels.Clear(); diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 1a93c9f..0b3d446 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -41,7 +41,7 @@ namespace OpenSim.Tests.Common public class TestScene : Scene { public TestScene( - RegionInfo regInfo, AgentCircuitManager authen, + RegionInfo regInfo, AgentCircuitManager authen, ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) : base(regInfo, authen, simDataService, estateDataService, @@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); Console.WriteLine("TestScene destructor called"); } - + /// /// Temporarily override session authentication for tests (namely teleport). /// @@ -68,7 +68,7 @@ namespace OpenSim.Tests.Common reason = String.Empty; return true; } - + public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter { get { return m_asyncSceneObjectDeleter; } diff --git a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs index 2b272e6..77f1793 100644 --- a/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestXInventoryDataPlugin.cs @@ -89,7 +89,7 @@ namespace OpenSim.Tests.Common m_allItems[item.inventoryID] = item.Clone(); // Console.WriteLine( -// "Added item {0} {1}, folder {2}, creator {3}, owner {4}", +// "Added item {0} {1}, folder {2}, creator {3}, owner {4}", // item.inventoryName, item.inventoryID, item.parentFolderID, item.creatorID, item.avatarID); return true; @@ -123,8 +123,8 @@ namespace OpenSim.Tests.Common public bool MoveItem(string id, string newParent) { throw new NotImplementedException(); } - public bool MoveFolder(string id, string newParent) - { + public bool MoveFolder(string id, string newParent) + { // Don't use GetFolders() here - it takes a clone! XInventoryFolder folder = m_allFolders[new UUID(id)]; @@ -133,11 +133,11 @@ namespace OpenSim.Tests.Common folder.parentFolderID = new UUID(newParent); -// XInventoryFolder[] newParentFolders +// XInventoryFolder[] newParentFolders // = GetFolders(new string[] { "folderID" }, new string[] { folder.parentFolderID.ToString() }); // Console.WriteLine( -// "Moved folder {0} {1}, to {2} {3}", +// "Moved folder {0} {1}, to {2} {3}", // folder.folderName, folder.folderID, newParentFolders[0].folderName, folder.parentFolderID); // TODO: Really need to implement folder version incrementing, though this should be common code anyway, diff --git a/OpenSim/Tests/Common/TestHelpers.cs b/OpenSim/Tests/Common/TestHelpers.cs index 6bf23f8..2b2af34 100644 --- a/OpenSim/Tests/Common/TestHelpers.cs +++ b/OpenSim/Tests/Common/TestHelpers.cs @@ -81,9 +81,9 @@ namespace OpenSim.Tests.Common return false; } - + /// - /// A debugging method that can be used to print out which test method you are in + /// A debugging method that can be used to print out which test method you are in /// public static void InMethod() { @@ -129,7 +129,7 @@ namespace OpenSim.Tests.Common { string rawUuid = stem.PadRight(32, '0'); - return UUID.Parse(rawUuid); + return UUID.Parse(rawUuid); } /// @@ -158,7 +158,7 @@ namespace OpenSim.Tests.Common { string rawUuid = stem.PadLeft(32, '0'); - return UUID.Parse(rawUuid); + return UUID.Parse(rawUuid); } } } diff --git a/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs b/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs index 671aca7..1549851 100644 --- a/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs +++ b/OpenSim/Tests/Robust/Clients/Grid/GridClient.cs @@ -95,7 +95,7 @@ namespace Robust.Tests Assert.AreNotEqual(regions, null, "GetRegionsByName failed"); Assert.AreEqual(regions.Count, 3, "GetRegionsByName should return 3"); - regions = m_Connector.GetRegionRange(UUID.Zero, + regions = m_Connector.GetRegionRange(UUID.Zero, (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002), (int)Util.RegionToWorldLoc(900), (int)Util.RegionToWorldLoc(1002) ); Assert.AreNotEqual(regions, null, "GetRegionRange failed"); @@ -126,7 +126,7 @@ namespace Robust.Tests region.ExternalHostName = "127.0.0.1"; region.HttpPort = 9000; region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 9000); - + return region; } } diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index d5c7dcb..fe46a4f 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs @@ -176,7 +176,7 @@ namespace Robust.Tests Assert.NotNull(items, "(Repeat) Failed to get multiple items"); Assert.IsTrue(items.Length == 2, "(Repeat) Requested 2 items, but didn't receive 2 items"); - // This item doesn't exist, but [0] does, and it's cached. + // This item doesn't exist, but [0] does, and it's cached. uuids[1] = new UUID("bb000000-0000-0000-0000-0000000000bb"); // Fetching should return 2 items, but [1] should be null items = m_Connector.GetMultipleItems(m_userID, uuids); @@ -185,7 +185,7 @@ namespace Robust.Tests Assert.AreEqual("Test Notecard 1", items[0].Name, "(Three times) Wrong name for Notecard 1"); Assert.IsNull(items[1], "(Three times) Expecting 2nd item to be null"); - // Now both don't exist + // Now both don't exist uuids[0] = new UUID("aa000000-0000-0000-0000-0000000000aa"); items = m_Connector.GetMultipleItems(m_userID, uuids); Assert.Null(items[0], "Request to multiple non-existent items is supposed to return null [0]"); diff --git a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs index 0ab407e..5e6a638 100644 --- a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs +++ b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs @@ -105,7 +105,7 @@ namespace OpenSim.Tests.Stress public void Draw() { SceneObjectGroup so = SceneHelpers.AddSceneObject(m_tests.Scene); - + while (Ready) { UUID originalTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; @@ -120,7 +120,7 @@ namespace OpenSim.Tests.Stress string.Format("PenColour BLACK; MoveTo 40,220; FontSize 32; Text {0};", text), "", 0); - + Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); Pass++; -- cgit v1.1 From c74fa02d87058e1d974b47c9a4d49c60ded07b51 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 13 Jan 2017 17:09:08 +0000 Subject: Harmonize case in Permissions enum --- OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs index 5a46201..e188665 100644 --- a/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/UserInventoryHelpers.cs @@ -129,9 +129,9 @@ namespace OpenSim.Tests.Common item.AssetType = asset.Type; item.InvType = (int)itemType; item.BasePermissions = (uint)OpenMetaverse.PermissionMask.All | - (uint)(Framework.PermissionMask.foldedMask | Framework.PermissionMask.foldedCopy | Framework.PermissionMask.foldedModify | Framework.PermissionMask.foldedTransfer); + (uint)(Framework.PermissionMask.FoldedMask | Framework.PermissionMask.FoldedCopy | Framework.PermissionMask.FoldedModify | Framework.PermissionMask.FoldedTransfer); item.CurrentPermissions = (uint)OpenMetaverse.PermissionMask.All | - (uint)(Framework.PermissionMask.foldedMask | Framework.PermissionMask.foldedCopy | Framework.PermissionMask.foldedModify | Framework.PermissionMask.foldedTransfer); + (uint)(Framework.PermissionMask.FoldedMask | Framework.PermissionMask.FoldedCopy | Framework.PermissionMask.FoldedModify | Framework.PermissionMask.FoldedTransfer); InventoryFolderBase folder = InventoryArchiveUtils.FindFoldersByPath(scene.InventoryService, userId, path)[0]; @@ -371,4 +371,4 @@ namespace OpenSim.Tests.Common return InventoryArchiveUtils.FindItemsByPath(inventoryService, userId, path); } } -} \ No newline at end of file +} -- cgit v1.1 From 63383bf3c5f5923b33e43ddd6b24b5616288ff4f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 14 Apr 2017 21:55:37 +0100 Subject: add functions to send entity updates imediatly, except for avatars (or now) they should be use to bypass normal delayed updates, for debug --- OpenSim/Tests/Common/Mock/TestClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index e2f57b5..a835925 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -760,7 +760,11 @@ namespace OpenSim.Tests.Common { } - public void SendAvatarDataImmediate(ISceneEntity avatar) + public void SendEntityFullUpdateImmediate(ISceneEntity ent) + { + } + + public void SendEntityTerseUpdateImmediate(ISceneEntity ent) { } -- cgit v1.1 From 45096b6238a3b6335429a680fa0bae0a6c0ce190 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 1 May 2017 07:06:50 -0700 Subject: Initial commit of the emerging test suite for permissions and more. --- OpenSim/Tests/Permissions/DirectTransferTests.cs | 252 +++++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 OpenSim/Tests/Permissions/DirectTransferTests.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs new file mode 100644 index 0000000..7716776 --- /dev/null +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -0,0 +1,252 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Threading; +using Nini.Config; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; +using OpenSim.Region.CoreModules.Framework.InventoryAccess; +using OpenSim.Region.Framework.Scenes.Serialization; +using OpenSim.Services.Interfaces; +using OpenSim.Tests.Common; +using PermissionMask = OpenSim.Framework.PermissionMask; + +namespace OpenSim.Tests.Permissions +{ + /// + /// Basic scene object tests (create, read and delete but not update). + /// + [TestFixture] + public class DirectTransferTests : OpenSimTestCase + { + private static string Perms = "Owner: {0}; Group: {1}; Everyone: {2}; Next: {3}"; + protected TestScene m_Scene; + private ScenePresence[] m_Avatars = new ScenePresence[3]; + + [SetUp] + public override void SetUp() + { + base.SetUp(); + TestHelpers.EnableLogging(); + + IConfigSource config = new IniConfigSource(); + config.AddConfig("Messaging"); + config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + config.AddConfig("InventoryService"); + config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService"); + config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin"); + + m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config); + // Add modules + SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule()); + + // Add 3 avatars + for (int i = 0; i < 3; i++) + { + UUID id = TestHelpers.ParseTail(i+1); + + m_Avatars[i] = AddScenePresence("Bot", "Bot_" + i, id); + Assert.That(m_Avatars[i], Is.Not.Null); + Assert.That(m_Avatars[i].IsChildAgent, Is.False); + Assert.That(m_Avatars[i].UUID, Is.EqualTo(id)); + + Assert.That(m_Scene.GetScenePresences().Count, Is.EqualTo(i+1)); + } + } + + /// + /// Test adding an object to a scene. + /// + [Test] + public void TestGiveCBox() + { + TestHelpers.InMethod(); + + // Create a C Box + SceneObjectGroup boxC = AddSceneObject("Box C", 10, 1, m_Avatars[0].UUID); + + // field = 16 is NextOwner + // set = 1 means add the permission; set = 0 means remove permission + m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, + ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Copy, 1); + + m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, + ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Transfer, 0); + PrintPerms(boxC); + + Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Copy) != 0); + Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Modify) == 0); + Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Transfer) == 0); + + InventoryItemBase item = TakeCopyToInventory(boxC); + + GiveInventoryItem(item.ID, m_Avatars[0], m_Avatars[1]); + + item = GetItemFromInventory(m_Avatars[1].UUID, "Objects", "Box C"); + + // Check the receiver + PrintPerms(item); + Assert.True((item.BasePermissions & (int)PermissionMask.Copy) != 0); + Assert.True((item.BasePermissions & (int)PermissionMask.Modify) == 0); + Assert.True((item.BasePermissions & (int)PermissionMask.Transfer) == 0); + + // Rez it and check perms in scene too + m_Scene.RezObject(m_Avatars[1].ControllingClient, item.ID, UUID.Zero, Vector3.One, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero); + Assert.That(m_Scene.GetSceneObjectGroups().Count, Is.EqualTo(2)); + SceneObjectGroup copyBoxC = m_Scene.GetSceneObjectGroups().Find(sog => sog.OwnerID == m_Avatars[1].UUID); + PrintPerms(copyBoxC); + Assert.That(copyBoxC, Is.Not.Null); + + } + + #region Helper Functions + + private void PrintPerms(SceneObjectGroup sog) + { + Console.WriteLine("SOG " + sog.Name + ": " + String.Format(Perms, (PermissionMask)sog.EffectiveOwnerPerms, + (PermissionMask)sog.EffectiveGroupPerms, (PermissionMask)sog.EffectiveEveryOnePerms, (PermissionMask)sog.RootPart.NextOwnerMask)); + + } + + private void PrintPerms(InventoryItemBase item) + { + Console.WriteLine("Inv " + item.Name + ": " + String.Format(Perms, (PermissionMask)item.BasePermissions, + (PermissionMask)item.GroupPermissions, (PermissionMask)item.EveryOnePermissions, (PermissionMask)item.NextPermissions)); + + } + + private ScenePresence AddScenePresence(string first, string last, UUID id) + { + UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_Scene, first, last, id, "pw"); + ScenePresence sp = SceneHelpers.AddScenePresence(m_Scene, id); + Assert.That(m_Scene.AuthenticateHandler.GetAgentCircuitData(id), Is.Not.Null); + + return sp; + } + + private SceneObjectGroup AddSceneObject(string name, int suffix, int partsToTestCount, UUID ownerID) + { + TestHelpers.InMethod(); + + SceneObjectGroup so = SceneHelpers.CreateSceneObject(partsToTestCount, ownerID, name, suffix); + so.Name = name; + so.Description = name; + + Assert.That(m_Scene.AddNewSceneObject(so, false), Is.True); + SceneObjectGroup retrievedSo = m_Scene.GetSceneObjectGroup(so.UUID); + + // If the parts have the same UUID then we will consider them as one and the same + Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); + + return so; + } + + private InventoryItemBase TakeCopyToInventory(SceneObjectGroup sog) + { + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects"); + Assert.That(objsFolder, Is.Not.Null); + + List localIds = new List(); localIds.Add(sog.LocalId); + m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID); + Thread.Sleep(5000); + + List items = m_Scene.InventoryService.GetFolderItems(sog.OwnerID, objsFolder.ID); + InventoryItemBase item = items.Find(i => i.Name == sog.Name); + Assert.That(item, Is.Not.Null); + + return item; + + } + + private InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName) + { + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, userID, folderName); + Assert.That(objsFolder, Is.Not.Null); + List items = m_Scene.InventoryService.GetFolderItems(userID, objsFolder.ID); + InventoryItemBase item = items.Find(i => i.Name == itemName); + Assert.That(item, Is.Not.Null); + + return item; + } + + private void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp) + { + TestClient giverClient = (TestClient)giverSp.ControllingClient; + TestClient receiverClient = (TestClient)receiverSp.ControllingClient; + + UUID initialSessionId = TestHelpers.ParseTail(0x10); + byte[] giveImBinaryBucket = new byte[17]; + byte[] itemIdBytes = itemId.GetBytes(); + Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); + + GridInstantMessage giveIm + = new GridInstantMessage( + m_Scene, + giverSp.UUID, + giverSp.Name, + receiverSp.UUID, + (byte)InstantMessageDialog.InventoryOffered, + false, + "inventory offered msg", + initialSessionId, + false, + Vector3.Zero, + giveImBinaryBucket, + true); + + giverClient.HandleImprovedInstantMessage(giveIm); + + // These details might not all be correct. + GridInstantMessage acceptIm + = new GridInstantMessage( + m_Scene, + receiverSp.UUID, + receiverSp.Name, + giverSp.UUID, + (byte)InstantMessageDialog.InventoryAccepted, + false, + "inventory accepted msg", + initialSessionId, + false, + Vector3.Zero, + null, + true); + + receiverClient.HandleImprovedInstantMessage(acceptIm); + } + #endregion + } +} \ No newline at end of file -- cgit v1.1 From 9c6dd5d967d44d2eb222a2382d9f19572b871d87 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 1 May 2017 10:09:31 -0700 Subject: Perms test framework: make a lot of things more generic. --- OpenSim/Tests/Permissions/Common.cs | 259 +++++++++++++++++++++++ OpenSim/Tests/Permissions/DirectTransferTests.cs | 208 +++--------------- 2 files changed, 293 insertions(+), 174 deletions(-) create mode 100644 OpenSim/Tests/Permissions/Common.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs new file mode 100644 index 0000000..63b91b6 --- /dev/null +++ b/OpenSim/Tests/Permissions/Common.cs @@ -0,0 +1,259 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Threading; +using Nini.Config; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; +using OpenSim.Region.CoreModules.Framework.InventoryAccess; +using OpenSim.Region.Framework.Scenes.Serialization; +using OpenSim.Services.Interfaces; +using OpenSim.Tests.Common; +using PermissionMask = OpenSim.Framework.PermissionMask; + +namespace OpenSim.Tests.Permissions +{ + [SetUpFixture] + public class Common : OpenSimTestCase + { + public static Common TheInstance; + + public static TestScene TheScene + { + get { return TheInstance.m_Scene; } + } + + public static ScenePresence[] TheAvatars + { + get { return TheInstance.m_Avatars; } + } + + private static string Perms = "Owner: {0}; Group: {1}; Everyone: {2}; Next: {3}"; + private TestScene m_Scene; + private ScenePresence[] m_Avatars = new ScenePresence[3]; + + [SetUp] + public override void SetUp() + { + if (TheInstance == null) + TheInstance = this; + + base.SetUp(); + TestHelpers.EnableLogging(); + + IConfigSource config = new IniConfigSource(); + config.AddConfig("Messaging"); + config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + config.AddConfig("InventoryService"); + config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService"); + config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin"); + + m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config); + // Add modules + SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule()); + + SetUpBasicEnvironment(); + } + + /// + /// The basic environment consists of: + /// - 3 avatars: A1, A2, A3 + /// - 6 simple boxes inworld belonging to A0 and with Next Owner perms: + /// C, CT, MC, MCT, MT, T + /// - Copies of all of these boxes in A0's inventory in the Objects folder + /// - One additional box in A0's inventory which is a copy of MCT, but + /// with C removed in inventory. This one is called MCT-C + /// + private void SetUpBasicEnvironment() + { + Console.WriteLine("===> SetUpBasicEnvironment <==="); + + // Add 3 avatars + for (int i = 0; i < 3; i++) + { + UUID id = TestHelpers.ParseTail(i + 1); + + m_Avatars[i] = AddScenePresence("Bot", "Bot_" + (i+1), id); + Assert.That(m_Avatars[i], Is.Not.Null); + Assert.That(m_Avatars[i].IsChildAgent, Is.False); + Assert.That(m_Avatars[i].UUID, Is.EqualTo(id)); + Assert.That(m_Scene.GetScenePresences().Count, Is.EqualTo(i + 1)); + } + + AddA1Object("Box C", 10, PermissionMask.Copy); + AddA1Object("Box CT", 11, PermissionMask.Copy | PermissionMask.Transfer); + AddA1Object("Box MC", 12, PermissionMask.Modify | PermissionMask.Copy); + AddA1Object("Box MCT", 13, PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer); + AddA1Object("Box MT", 14, PermissionMask.Modify | PermissionMask.Transfer); + AddA1Object("Box T", 15, PermissionMask.Transfer); + + Thread.Sleep(5000); + + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[0].UUID, "Objects"); + List items = m_Scene.InventoryService.GetFolderItems(m_Avatars[0].UUID, objsFolder.ID); + Assert.That(items.Count, Is.EqualTo(6)); + } + + private ScenePresence AddScenePresence(string first, string last, UUID id) + { + UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_Scene, first, last, id, "pw"); + ScenePresence sp = SceneHelpers.AddScenePresence(m_Scene, id); + Assert.That(m_Scene.AuthenticateHandler.GetAgentCircuitData(id), Is.Not.Null); + + return sp; + } + + private void AddA1Object(string name, int suffix, PermissionMask nextOwnerPerms) + { + // Create a Box. Default permissions are just T + SceneObjectGroup box = AddSceneObject(name, suffix, 1, m_Avatars[0].UUID); + Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Copy) == 0); + Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Modify) == 0); + Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Transfer) != 0); + + // field = 16 is NextOwner + // set = 1 means add the permission; set = 0 means remove permission + + if ((nextOwnerPerms & PermissionMask.Copy) != 0) + m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, + ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Copy, 1); + + if ((nextOwnerPerms & PermissionMask.Modify) != 0) + m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, + ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Modify, 1); + + if ((nextOwnerPerms & PermissionMask.Transfer) == 0) + m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, + ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Transfer, 0); + + PrintPerms(box); + AssertPermissions(nextOwnerPerms, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name); + + TakeCopyToInventory(box); + + } + + public void PrintPerms(SceneObjectGroup sog) + { + Console.WriteLine("SOG " + sog.Name + " (" + sog.OwnerID.ToString().Substring(34) + "): " + + String.Format(Perms, (PermissionMask)sog.EffectiveOwnerPerms, + (PermissionMask)sog.EffectiveGroupPerms, (PermissionMask)sog.EffectiveEveryOnePerms, (PermissionMask)sog.RootPart.NextOwnerMask)); + + } + + public void PrintPerms(InventoryItemBase item) + { + Console.WriteLine("Inv " + item.Name + " (" + item.Owner.ToString().Substring(34) + "): " + + String.Format(Perms, (PermissionMask)item.BasePermissions, + (PermissionMask)item.GroupPermissions, (PermissionMask)item.EveryOnePermissions, (PermissionMask)item.NextPermissions)); + + } + + public void AssertPermissions(PermissionMask desired, PermissionMask actual, string message) + { + if ((desired & PermissionMask.Copy) != 0) + Assert.True((actual & PermissionMask.Copy) != 0, message); + else + Assert.True((actual & PermissionMask.Copy) == 0, message); + + if ((desired & PermissionMask.Modify) != 0) + Assert.True((actual & PermissionMask.Modify) != 0, message); + else + Assert.True((actual & PermissionMask.Modify) == 0, message); + + if ((desired & PermissionMask.Transfer) != 0) + Assert.True((actual & PermissionMask.Transfer) != 0, message); + else + Assert.True((actual & PermissionMask.Transfer) == 0, message); + + } + + public SceneObjectGroup AddSceneObject(string name, int suffix, int partsToTestCount, UUID ownerID) + { + SceneObjectGroup so = SceneHelpers.CreateSceneObject(partsToTestCount, ownerID, name, suffix); + so.Name = name; + so.Description = name; + + Assert.That(m_Scene.AddNewSceneObject(so, false), Is.True); + SceneObjectGroup retrievedSo = m_Scene.GetSceneObjectGroup(so.UUID); + + // If the parts have the same UUID then we will consider them as one and the same + Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); + + return so; + } + + public void TakeCopyToInventory(SceneObjectGroup sog) + { + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects"); + Assert.That(objsFolder, Is.Not.Null); + + List localIds = new List(); localIds.Add(sog.LocalId); + // This is an async operation + m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID); + } + + public InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName) + { + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, userID, folderName); + Assert.That(objsFolder, Is.Not.Null); + List items = m_Scene.InventoryService.GetFolderItems(userID, objsFolder.ID); + InventoryItemBase item = items.Find(i => i.Name == itemName); + Assert.That(item, Is.Not.Null); + + return item; + } + + public void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp) + { + TestClient giverClient = (TestClient)giverSp.ControllingClient; + TestClient receiverClient = (TestClient)receiverSp.ControllingClient; + + UUID initialSessionId = TestHelpers.ParseTail(0x10); + byte[] giveImBinaryBucket = new byte[17]; + byte[] itemIdBytes = itemId.GetBytes(); + Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); + + GridInstantMessage giveIm + = new GridInstantMessage( + m_Scene, + giverSp.UUID, + giverSp.Name, + receiverSp.UUID, + (byte)InstantMessageDialog.InventoryOffered, + false, + "inventory offered msg", + initialSessionId, + false, + Vector3.Zero, + giveImBinaryBucket, + true); + + giverClient.HandleImprovedInstantMessage(giveIm); + + // These details might not all be correct. + GridInstantMessage acceptIm + = new GridInstantMessage( + m_Scene, + receiverSp.UUID, + receiverSp.Name, + giverSp.UUID, + (byte)InstantMessageDialog.InventoryAccepted, + false, + "inventory accepted msg", + initialSessionId, + false, + Vector3.Zero, + null, + true); + + receiverClient.HandleImprovedInstantMessage(acceptIm); + } + } +} diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index 7716776..e103d01 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -48,205 +48,65 @@ namespace OpenSim.Tests.Permissions /// Basic scene object tests (create, read and delete but not update). /// [TestFixture] - public class DirectTransferTests : OpenSimTestCase + public class DirectTransferTests { - private static string Perms = "Owner: {0}; Group: {1}; Everyone: {2}; Next: {3}"; - protected TestScene m_Scene; - private ScenePresence[] m_Avatars = new ScenePresence[3]; [SetUp] - public override void SetUp() + public void SetUp() { - base.SetUp(); - TestHelpers.EnableLogging(); - - IConfigSource config = new IniConfigSource(); - config.AddConfig("Messaging"); - config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); - config.AddConfig("Modules"); - config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); - config.AddConfig("InventoryService"); - config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService"); - config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin"); - - m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config); - // Add modules - SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule()); - - // Add 3 avatars - for (int i = 0; i < 3; i++) - { - UUID id = TestHelpers.ParseTail(i+1); - - m_Avatars[i] = AddScenePresence("Bot", "Bot_" + i, id); - Assert.That(m_Avatars[i], Is.Not.Null); - Assert.That(m_Avatars[i].IsChildAgent, Is.False); - Assert.That(m_Avatars[i].UUID, Is.EqualTo(id)); - - Assert.That(m_Scene.GetScenePresences().Count, Is.EqualTo(i+1)); - } } /// - /// Test adding an object to a scene. + /// Test giving a C object. /// [Test] public void TestGiveCBox() { TestHelpers.InMethod(); - // Create a C Box - SceneObjectGroup boxC = AddSceneObject("Box C", 10, 1, m_Avatars[0].UUID); - - // field = 16 is NextOwner - // set = 1 means add the permission; set = 0 means remove permission - m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, - ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Copy, 1); - - m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID, - ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Transfer, 0); - PrintPerms(boxC); - - Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Copy) != 0); - Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Modify) == 0); - Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Transfer) == 0); - - InventoryItemBase item = TakeCopyToInventory(boxC); - - GiveInventoryItem(item.ID, m_Avatars[0], m_Avatars[1]); - - item = GetItemFromInventory(m_Avatars[1].UUID, "Objects", "Box C"); - - // Check the receiver - PrintPerms(item); - Assert.True((item.BasePermissions & (int)PermissionMask.Copy) != 0); - Assert.True((item.BasePermissions & (int)PermissionMask.Modify) == 0); - Assert.True((item.BasePermissions & (int)PermissionMask.Transfer) == 0); - - // Rez it and check perms in scene too - m_Scene.RezObject(m_Avatars[1].ControllingClient, item.ID, UUID.Zero, Vector3.One, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero); - Assert.That(m_Scene.GetSceneObjectGroups().Count, Is.EqualTo(2)); - SceneObjectGroup copyBoxC = m_Scene.GetSceneObjectGroups().Find(sog => sog.OwnerID == m_Avatars[1].UUID); - PrintPerms(copyBoxC); - Assert.That(copyBoxC, Is.Not.Null); - - } - - #region Helper Functions - - private void PrintPerms(SceneObjectGroup sog) - { - Console.WriteLine("SOG " + sog.Name + ": " + String.Format(Perms, (PermissionMask)sog.EffectiveOwnerPerms, - (PermissionMask)sog.EffectiveGroupPerms, (PermissionMask)sog.EffectiveEveryOnePerms, (PermissionMask)sog.RootPart.NextOwnerMask)); - - } - - private void PrintPerms(InventoryItemBase item) - { - Console.WriteLine("Inv " + item.Name + ": " + String.Format(Perms, (PermissionMask)item.BasePermissions, - (PermissionMask)item.GroupPermissions, (PermissionMask)item.EveryOnePermissions, (PermissionMask)item.NextPermissions)); - + // C, CT, MC, MCT, MT, T + string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T"}; + PermissionMask[] perms = new PermissionMask[6] { + PermissionMask.Copy, + PermissionMask.Copy | PermissionMask.Transfer, + PermissionMask.Modify | PermissionMask.Copy, + PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer, + PermissionMask.Modify | PermissionMask.Transfer, + PermissionMask.Transfer + }; + + for (int i = 0; i < 6; i++) + TestOneBox(names[i], perms[i]); } - private ScenePresence AddScenePresence(string first, string last, UUID id) + private void TestOneBox(string name, PermissionMask mask) { - UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_Scene, first, last, id, "pw"); - ScenePresence sp = SceneHelpers.AddScenePresence(m_Scene, id); - Assert.That(m_Scene.AuthenticateHandler.GetAgentCircuitData(id), Is.Not.Null); - - return sp; - } - - private SceneObjectGroup AddSceneObject(string name, int suffix, int partsToTestCount, UUID ownerID) - { - TestHelpers.InMethod(); - - SceneObjectGroup so = SceneHelpers.CreateSceneObject(partsToTestCount, ownerID, name, suffix); - so.Name = name; - so.Description = name; - - Assert.That(m_Scene.AddNewSceneObject(so, false), Is.True); - SceneObjectGroup retrievedSo = m_Scene.GetSceneObjectGroup(so.UUID); + InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[0].UUID, "Objects", name); - // If the parts have the same UUID then we will consider them as one and the same - Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount)); + Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[0], Common.TheAvatars[1]); - return so; - } + item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); - private InventoryItemBase TakeCopyToInventory(SceneObjectGroup sog) - { - InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects"); - Assert.That(objsFolder, Is.Not.Null); + // Check the receiver + Common.TheInstance.PrintPerms(item); + Common.TheInstance.AssertPermissions(mask, (PermissionMask)item.BasePermissions, item.Owner.ToString().Substring(34) + " : " + item.Name); - List localIds = new List(); localIds.Add(sog.LocalId); - m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID); - Thread.Sleep(5000); + int nObjects = Common.TheScene.GetSceneObjectGroups().Count; + // Rez it and check perms in scene too + Common.TheScene.RezObject(Common.TheAvatars[1].ControllingClient, item.ID, UUID.Zero, Vector3.One, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero); + Assert.That(Common.TheScene.GetSceneObjectGroups().Count, Is.EqualTo(nObjects + 1)); - List items = m_Scene.InventoryService.GetFolderItems(sog.OwnerID, objsFolder.ID); - InventoryItemBase item = items.Find(i => i.Name == sog.Name); - Assert.That(item, Is.Not.Null); + SceneObjectGroup box = Common.TheScene.GetSceneObjectGroups().Find(sog => sog.OwnerID == Common.TheAvatars[1].UUID && sog.Name == name); + Common.TheInstance.PrintPerms(box); + Assert.That(box, Is.Not.Null); - return item; + // Check Owner permissions + Common.TheInstance.AssertPermissions(mask, (PermissionMask)box.EffectiveOwnerPerms, box.OwnerID.ToString().Substring(34) + " : " + box.Name); - } + // Check Next Owner permissions + Common.TheInstance.AssertPermissions(mask, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name); - private InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName) - { - InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, userID, folderName); - Assert.That(objsFolder, Is.Not.Null); - List items = m_Scene.InventoryService.GetFolderItems(userID, objsFolder.ID); - InventoryItemBase item = items.Find(i => i.Name == itemName); - Assert.That(item, Is.Not.Null); - - return item; } - private void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp) - { - TestClient giverClient = (TestClient)giverSp.ControllingClient; - TestClient receiverClient = (TestClient)receiverSp.ControllingClient; - - UUID initialSessionId = TestHelpers.ParseTail(0x10); - byte[] giveImBinaryBucket = new byte[17]; - byte[] itemIdBytes = itemId.GetBytes(); - Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length); - - GridInstantMessage giveIm - = new GridInstantMessage( - m_Scene, - giverSp.UUID, - giverSp.Name, - receiverSp.UUID, - (byte)InstantMessageDialog.InventoryOffered, - false, - "inventory offered msg", - initialSessionId, - false, - Vector3.Zero, - giveImBinaryBucket, - true); - - giverClient.HandleImprovedInstantMessage(giveIm); - - // These details might not all be correct. - GridInstantMessage acceptIm - = new GridInstantMessage( - m_Scene, - receiverSp.UUID, - receiverSp.Name, - giverSp.UUID, - (byte)InstantMessageDialog.InventoryAccepted, - false, - "inventory accepted msg", - initialSessionId, - false, - Vector3.Zero, - null, - true); - - receiverClient.HandleImprovedInstantMessage(acceptIm); - } - #endregion } } \ No newline at end of file -- cgit v1.1 From 1ca2a7937ebf246bb2ebe4b1355f8068912ea4b0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 1 May 2017 14:58:03 -0700 Subject: Permissions tests: added test with 2 direct transfers with permission changes in between (in inventory) --- OpenSim/Tests/Permissions/Common.cs | 64 +++++++++++++++++++++++- OpenSim/Tests/Permissions/DirectTransferTests.cs | 51 +++++++++++++++++-- 2 files changed, 110 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index 63b91b6..84dadf2 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -93,11 +93,16 @@ namespace OpenSim.Tests.Permissions AddA1Object("Box MT", 14, PermissionMask.Modify | PermissionMask.Transfer); AddA1Object("Box T", 15, PermissionMask.Transfer); + // MCT-C + AddA1Object("Box MCT-C", 16, PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer); + Thread.Sleep(5000); InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[0].UUID, "Objects"); List items = m_Scene.InventoryService.GetFolderItems(m_Avatars[0].UUID, objsFolder.ID); - Assert.That(items.Count, Is.EqualTo(6)); + Assert.That(items.Count, Is.EqualTo(7)); + + RevokePermission(0, "Box MCT-C", PermissionMask.Copy); } private ScenePresence AddScenePresence(string first, string last, UUID id) @@ -139,6 +144,30 @@ namespace OpenSim.Tests.Permissions } + public void RevokePermission(int ownerIndex, string name, PermissionMask perm) + { + InventoryItemBase item = Common.TheInstance.GetItemFromInventory(m_Avatars[ownerIndex].UUID, "Objects", name); + Assert.That(item, Is.Not.Null); + + // Clone it, so to avoid aliasing -- just like the viewer does. + InventoryItemBase clone = Common.TheInstance.CloneInventoryItem(item); + // Revoke the permission in this copy + clone.NextPermissions &= ~(uint)perm; + Common.TheInstance.AssertPermissions((PermissionMask)clone.NextPermissions & ~perm, + (PermissionMask)clone.NextPermissions, Common.TheInstance.IdStr(clone)); + Assert.That(clone.ID == item.ID); + + // Update properties of the item in inventory. This should affect the original item above. + Common.TheScene.UpdateInventoryItemAsset(m_Avatars[ownerIndex].ControllingClient, UUID.Zero, clone.ID, clone); + + item = Common.TheInstance.GetItemFromInventory(m_Avatars[ownerIndex].UUID, "Objects", name); + Assert.That(item, Is.Not.Null); + Common.TheInstance.PrintPerms(item); + Common.TheInstance.AssertPermissions((PermissionMask)item.NextPermissions & ~perm, + (PermissionMask)item.NextPermissions, Common.TheInstance.IdStr(item)); + + } + public void PrintPerms(SceneObjectGroup sog) { Console.WriteLine("SOG " + sog.Name + " (" + sog.OwnerID.ToString().Substring(34) + "): " + @@ -210,6 +239,39 @@ namespace OpenSim.Tests.Permissions return item; } + public InventoryItemBase CloneInventoryItem(InventoryItemBase item) + { + InventoryItemBase clone = new InventoryItemBase(item.ID); + clone.Name = item.Name; + clone.Description = item.Description; + clone.AssetID = item.AssetID; + clone.AssetType = item.AssetType; + clone.BasePermissions = item.BasePermissions; + clone.CreatorId = item.CreatorId; + clone.CurrentPermissions = item.CurrentPermissions; + clone.EveryOnePermissions = item.EveryOnePermissions; + clone.Flags = item.Flags; + clone.Folder = item.Folder; + clone.GroupID = item.GroupID; + clone.GroupOwned = item.GroupOwned; + clone.GroupPermissions = item.GroupPermissions; + clone.InvType = item.InvType; + clone.NextPermissions = item.NextPermissions; + clone.Owner = item.Owner; + + return clone; + } + + public string IdStr(InventoryItemBase item) + { + return item.Owner.ToString().Substring(34) + " : " + item.Name; + } + + public string IdStr(SceneObjectGroup sog) + { + return sog.OwnerID.ToString().Substring(34) + " : " + sog.Name; + } + public void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp) { TestClient giverClient = (TestClient)giverSp.ControllingClient; diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index e103d01..3ca711a 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -48,7 +48,7 @@ namespace OpenSim.Tests.Permissions /// Basic scene object tests (create, read and delete but not update). ///
[TestFixture] - public class DirectTransferTests + public class DirectTransferTests { [SetUp] @@ -57,15 +57,15 @@ namespace OpenSim.Tests.Permissions } /// - /// Test giving a C object. + /// Test giving simple objecta with various combinations of next owner perms. /// [Test] - public void TestGiveCBox() + public void TestGiveBox() { TestHelpers.InMethod(); // C, CT, MC, MCT, MT, T - string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T"}; + string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T" }; PermissionMask[] perms = new PermissionMask[6] { PermissionMask.Copy, PermissionMask.Copy | PermissionMask.Transfer, @@ -108,5 +108,48 @@ namespace OpenSim.Tests.Permissions } + /// + /// Test giving simple objecta with variour combinations of next owner perms. + /// + [Test] + public void TestDoubleGiveWithChange() + { + TestHelpers.InMethod(); + + string name = "Box MCT-C"; + InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[0].UUID, "Objects", name); + + // Now give the item to A2. We give the original item, not a clone. + // The giving methods are supposed to duplicate it. + Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[0], Common.TheAvatars[1]); + + item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); + + // Check the receiver + Common.TheInstance.PrintPerms(item); + Common.TheInstance.AssertPermissions(PermissionMask.Modify | PermissionMask.Transfer, + (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); + + // --------------------------- + // Second transfer + //---------------------------- + + // A2 revokes M + Common.TheInstance.RevokePermission(1, name, PermissionMask.Modify); + + item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); + + // Now give the item to A3. We give the original item, not a clone. + // The giving methods are supposed to duplicate it. + Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[1], Common.TheAvatars[2]); + + item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[2].UUID, "Objects", name); + + // Check the receiver + Common.TheInstance.PrintPerms(item); + Common.TheInstance.AssertPermissions(PermissionMask.Transfer, + (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); + + } } } \ No newline at end of file -- cgit v1.1 From 3c43cdbbcc2687e2f5d4319c5c3c3cbad4930fab Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 1 May 2017 16:42:47 -0700 Subject: Added some indirect transfer tests -- Take Copy by another avatar --- OpenSim/Tests/Permissions/Common.cs | 40 ++++-- OpenSim/Tests/Permissions/DirectTransferTests.cs | 10 -- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 137 +++++++++++++++++++++ 3 files changed, 169 insertions(+), 18 deletions(-) create mode 100644 OpenSim/Tests/Permissions/IndirectTransferTests.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index 84dadf2..e62991b 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -1,6 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +using System; using System.Collections.Generic; -using System.Reflection; using System.Threading; using Nini.Config; using NUnit.Framework; @@ -10,7 +35,6 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Region.CoreModules.World.Permissions; using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; using OpenSim.Region.CoreModules.Framework.InventoryAccess; -using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Services.Interfaces; using OpenSim.Tests.Common; using PermissionMask = OpenSim.Framework.PermissionMask; @@ -67,7 +91,7 @@ namespace OpenSim.Tests.Permissions /// - 6 simple boxes inworld belonging to A0 and with Next Owner perms: /// C, CT, MC, MCT, MT, T /// - Copies of all of these boxes in A0's inventory in the Objects folder - /// - One additional box in A0's inventory which is a copy of MCT, but + /// - One additional box inworld and in A0's inventory which is a copy of MCT, but /// with C removed in inventory. This one is called MCT-C ///
private void SetUpBasicEnvironment() @@ -140,7 +164,7 @@ namespace OpenSim.Tests.Permissions PrintPerms(box); AssertPermissions(nextOwnerPerms, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name); - TakeCopyToInventory(box); + TakeCopyToInventory(0, box); } @@ -218,14 +242,14 @@ namespace OpenSim.Tests.Permissions return so; } - public void TakeCopyToInventory(SceneObjectGroup sog) + public void TakeCopyToInventory(int userIndex, SceneObjectGroup sog) { - InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects"); + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[userIndex].UUID, "Objects"); Assert.That(objsFolder, Is.Not.Null); List localIds = new List(); localIds.Add(sog.LocalId); // This is an async operation - m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID); + m_Scene.DeRezObjects((IClientAPI)m_Avatars[userIndex].ClientView, localIds, m_Avatars[userIndex].UUID, DeRezAction.TakeCopy, objsFolder.ID); } public InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName) diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index 3ca711a..3b711a1 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -25,20 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Threading; -using Nini.Config; using NUnit.Framework; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; -using OpenSim.Region.CoreModules.World.Permissions; -using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer; -using OpenSim.Region.CoreModules.Framework.InventoryAccess; -using OpenSim.Region.Framework.Scenes.Serialization; -using OpenSim.Services.Interfaces; using OpenSim.Tests.Common; using PermissionMask = OpenSim.Framework.PermissionMask; diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs new file mode 100644 index 0000000..6a6ba2f --- /dev/null +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -0,0 +1,137 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System.Collections.Generic; +using System.Threading; +using NUnit.Framework; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using PermissionMask = OpenSim.Framework.PermissionMask; + +namespace OpenSim.Tests.Permissions +{ + /// + /// Basic scene object tests (create, read and delete but not update). + /// + [TestFixture] + public class IndirectTransferTests + { + + [SetUp] + public void SetUp() + { + // Delete everything in A2 and A3's Objects folders from previous tests + for (int i = 1; i < 3; i++) + { + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects"); + Assert.That(objsFolder, Is.Not.Null); + + List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); + List ids = new List(); + foreach (InventoryItemBase it in items) + ids.Add(it.ID); + + Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids); + items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); + Assert.That(items.Count, Is.EqualTo(0), "A" + (i+1)); + } + } + + /// + /// Test giving simple objecta with various combinations of next owner perms. + /// + [Test] + public void SimpleTakeCopy() + { + TestHelpers.InMethod(); + + // The Objects folder of A2 + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[1].UUID, "Objects"); + + // C, CT, MC, MCT, MT, T + string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T" }; + PermissionMask[] perms = new PermissionMask[6] { + PermissionMask.Copy, + PermissionMask.Copy | PermissionMask.Transfer, + PermissionMask.Modify | PermissionMask.Copy, + PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer, + PermissionMask.Modify | PermissionMask.Transfer, + PermissionMask.Transfer + }; + + // Try A2 takes copies of objects that cannot be copied. + for (int i = 0; i < 6; i++) + TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); + Thread.Sleep(5000); + + List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); + Assert.That(items.Count, Is.EqualTo(0)); + + // A1 makes the objects copyable + for (int i = 0; i < 6; i++) + MakeCopyable(Common.TheScene.GetSceneObjectGroups(), names[i]); + + // Try A2 takes copies of objects that can be copied. + for (int i = 0; i < 6; i++) + TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); + Thread.Sleep(5000); + + items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); + Assert.That(items.Count, Is.EqualTo(6)); + + for (int i = 0; i < 6; i++) + { + InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", names[i]); + Assert.That(item, Is.Not.Null); + Common.TheInstance.AssertPermissions(perms[i], (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); + } + } + + private void TakeOneBox(List objs, string name, PermissionMask mask) + { + SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID); + Assert.That(box, Is.Not.Null, name); + + // A2's inventory (index 1) + Common.TheInstance.TakeCopyToInventory(1, box); + } + + private void MakeCopyable(List objs, string name) + { + SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID); + Assert.That(box, Is.Not.Null, name); + + // field = 8 is Everyone + // set = 1 means add the permission; set = 0 means remove permission + Common.TheScene.HandleObjectPermissionsUpdate((IClientAPI)Common.TheAvatars[0].ClientView, Common.TheAvatars[0].UUID, + Common.TheAvatars[0].ControllingClient.SessionId, 8, box.LocalId, (uint)PermissionMask.Copy, 1); + Common.TheInstance.PrintPerms(box); + } + } +} \ No newline at end of file -- cgit v1.1 From 9c82ff76730c9eff80cace1ddece0148d8d0a7ee Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 1 May 2017 16:49:42 -0700 Subject: Shuffle some code around --- OpenSim/Tests/Permissions/Common.cs | 20 ++++++++++++++++++++ OpenSim/Tests/Permissions/DirectTransferTests.cs | 1 + OpenSim/Tests/Permissions/IndirectTransferTests.cs | 16 +--------------- 3 files changed, 22 insertions(+), 15 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index e62991b..f93c120 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -286,6 +286,26 @@ namespace OpenSim.Tests.Permissions return clone; } + public void DeleteObjectsFolders() + { + // Delete everything in A2 and A3's Objects folders, so we can restart + for (int i = 1; i < 3; i++) + { + InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects"); + Assert.That(objsFolder, Is.Not.Null); + + List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); + List ids = new List(); + foreach (InventoryItemBase it in items) + ids.Add(it.ID); + + Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids); + items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); + Assert.That(items.Count, Is.EqualTo(0), "A" + (i + 1)); + } + + } + public string IdStr(InventoryItemBase item) { return item.Owner.ToString().Substring(34) + " : " + item.Name; diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index 3b711a1..c68bbdf 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -44,6 +44,7 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + Common.TheInstance.DeleteObjectsFolders(); } /// diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 6a6ba2f..7d8027f 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -46,21 +46,7 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { - // Delete everything in A2 and A3's Objects folders from previous tests - for (int i = 1; i < 3; i++) - { - InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects"); - Assert.That(objsFolder, Is.Not.Null); - - List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); - List ids = new List(); - foreach (InventoryItemBase it in items) - ids.Add(it.ID); - - Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids); - items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID); - Assert.That(items.Count, Is.EqualTo(0), "A" + (i+1)); - } + Common.TheInstance.DeleteObjectsFolders(); } /// -- cgit v1.1 From 3a8dd24fd1c1aead0a81a4a9d63b59bbf9f10855 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 4 May 2017 11:37:13 +0100 Subject: move deep effective permissions aggregation to first time use and not on changes. There flag it is need with InvalidateDeepEffectivePerms(). Add config options PropagateGroupShareOutwards and PropagateAnyOneOutwards --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index fbd7e90..7902fb1 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -626,6 +626,7 @@ namespace OpenSim.Tests.Common //part.ObjectFlags |= (uint)PrimFlags.Phantom; scene.AddNewSceneObject(so, true); + so.InvalidateDeepEffectivePerms(); return so; } @@ -652,6 +653,7 @@ namespace OpenSim.Tests.Common SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail); scene.AddNewSceneObject(so, false); + so.InvalidateDeepEffectivePerms(); return so; } -- cgit v1.1 From dd883194959e082b3489deaa9935291ba2c6e53a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 4 May 2017 18:20:10 -0700 Subject: Add a groups module to the perms test suite --- OpenSim/Tests/Permissions/Common.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index f93c120..4ecce38 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -72,12 +72,21 @@ namespace OpenSim.Tests.Permissions IConfigSource config = new IniConfigSource(); config.AddConfig("Messaging"); config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule"); + config.AddConfig("Modules"); config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); + config.AddConfig("InventoryService"); config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService"); config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin"); + config.AddConfig("Groups"); + config.Configs["Groups"].Set("Enabled", "true"); + config.Configs["Groups"].Set("Module", "Groups Module V2"); + config.Configs["Groups"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestGroupsDataPlugin"); + config.Configs["Groups"].Set("ServicesConnectorModule", "Groups Local Service Connector"); + config.Configs["Groups"].Set("LocalService", "local"); + m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config); // Add modules SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule()); -- cgit v1.1 From 3f641d98bd4c9fa1ce5b98c8d071f53596d06a7a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 4 May 2017 20:17:54 -0700 Subject: Added a fully functional groups data layer for testing. --- OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs | 339 ++++++++++++++++++++++ 1 file changed, 339 insertions(+) create mode 100644 OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs new file mode 100644 index 0000000..8e2d8e6 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs @@ -0,0 +1,339 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using OpenMetaverse; +using OpenSim.Data; + +namespace OpenSim.Tests.Common.Mock +{ + public class TestGroupsDataPlugin : IGroupsData + { + class CompositeKey + { + private readonly string _key; + public string Key + { + get { return _key; } + } + + public CompositeKey(UUID _k1, string _k2) + { + _key = _k1.ToString() + _k2; + } + + public CompositeKey(UUID _k1, string _k2, string _k3) + { + _key = _k1.ToString() + _k2 + _k3; + } + + public override bool Equals(object obj) + { + if (obj is CompositeKey) + { + return Key == ((CompositeKey)obj).Key; + } + return false; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public override string ToString() + { + return Key; + } + } + + private Dictionary m_Groups; + private Dictionary m_Membership; + private Dictionary m_Roles; + private Dictionary m_RoleMembership; + private Dictionary m_Invites; + private Dictionary m_Notices; + private Dictionary m_Principals; + + public TestGroupsDataPlugin(string connectionString, string realm) + { + m_Groups = new Dictionary(); + m_Membership = new Dictionary(); + m_Roles = new Dictionary(); + m_RoleMembership = new Dictionary(); + m_Invites = new Dictionary(); + m_Notices = new Dictionary(); + m_Principals = new Dictionary(); + } + + #region groups table + public bool StoreGroup(GroupData data) + { + return false; + } + + public GroupData RetrieveGroup(UUID groupID) + { + if (m_Groups.ContainsKey(groupID)) + return m_Groups[groupID]; + + return null; + } + + public GroupData RetrieveGroup(string name) + { + return m_Groups.Values.First(g => g.Data.ContainsKey("Name") && g.Data["Name"] == name); + } + + public GroupData[] RetrieveGroups(string pattern) + { + if (string.IsNullOrEmpty(pattern)) + pattern = "1"; + + IEnumerable groups = m_Groups.Values.Where(g => g.Data.ContainsKey("Name") && (g.Data["Name"].StartsWith(pattern) || g.Data["Name"].EndsWith(pattern))); + + return (groups != null) ? groups.ToArray() : new GroupData[0]; + } + + public bool DeleteGroup(UUID groupID) + { + return m_Groups.Remove(groupID); + } + + public int GroupsCount() + { + return m_Groups.Count; + } + #endregion + + #region membership table + public MembershipData RetrieveMember(UUID groupID, string pricipalID) + { + CompositeKey dkey = new CompositeKey(groupID, pricipalID); + if (m_Membership.ContainsKey(dkey)) + return m_Membership[dkey]; + + return null; + } + + public MembershipData[] RetrieveMembers(UUID groupID) + { + IEnumerable keys = m_Membership.Keys.Where(k => k.Key.StartsWith(groupID.ToString())); + return keys.Where(m_Membership.ContainsKey).Select(x => m_Membership[x]).ToArray(); + } + + public MembershipData[] RetrieveMemberships(string principalID) + { + IEnumerable keys = m_Membership.Keys.Where(k => k.Key.EndsWith(principalID.ToString())); + return keys.Where(m_Membership.ContainsKey).Select(x => m_Membership[x]).ToArray(); + } + + public MembershipData[] RetrievePrincipalGroupMemberships(string principalID) + { + return RetrieveMemberships(principalID); + } + + public MembershipData RetrievePrincipalGroupMembership(string principalID, UUID groupID) + { + CompositeKey dkey = new CompositeKey(groupID, principalID); + if (m_Membership.ContainsKey(dkey)) + return m_Membership[dkey]; + return null; + } + + public bool StoreMember(MembershipData data) + { + CompositeKey dkey = new CompositeKey(data.GroupID, data.PrincipalID); + m_Membership[dkey] = data; + return true; + } + + public bool DeleteMember(UUID groupID, string principalID) + { + CompositeKey dkey = new CompositeKey(groupID, principalID); + if (m_Membership.ContainsKey(dkey)) + return m_Membership.Remove(dkey); + + return false; + } + + public int MemberCount(UUID groupID) + { + return m_Membership.Count; + } + #endregion + + #region roles table + public bool StoreRole(RoleData data) + { + CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString()); + m_Roles[dkey] = data; + return true; + } + + public RoleData RetrieveRole(UUID groupID, UUID roleID) + { + CompositeKey dkey = new CompositeKey(groupID, roleID.ToString()); + if (m_Roles.ContainsKey(dkey)) + return m_Roles[dkey]; + + return null; + } + + public RoleData[] RetrieveRoles(UUID groupID) + { + IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString())); + return keys.Where(m_Roles.ContainsKey).Select(x => m_Roles[x]).ToArray(); + } + + public bool DeleteRole(UUID groupID, UUID roleID) + { + CompositeKey dkey = new CompositeKey(groupID, roleID.ToString()); + if (m_Roles.ContainsKey(dkey)) + return m_Roles.Remove(dkey); + + return false; + } + + public int RoleCount(UUID groupID) + { + return m_Roles.Count; + } + #endregion + + #region rolememberhip table + public RoleMembershipData[] RetrieveRolesMembers(UUID groupID) + { + IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString())); + return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray(); + } + + public RoleMembershipData[] RetrieveRoleMembers(UUID groupID, UUID roleID) + { + IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString() + roleID.ToString())); + return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray(); + } + + public RoleMembershipData[] RetrieveMemberRoles(UUID groupID, string principalID) + { + IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString()) && k.Key.EndsWith(principalID)); + return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray(); + } + + public RoleMembershipData RetrieveRoleMember(UUID groupID, UUID roleID, string principalID) + { + CompositeKey dkey = new CompositeKey(groupID, roleID.ToString(), principalID); + if (m_RoleMembership.ContainsKey(dkey)) + return m_RoleMembership[dkey]; + + return null; + } + + public int RoleMemberCount(UUID groupID, UUID roleID) + { + return m_RoleMembership.Count; + } + + public bool StoreRoleMember(RoleMembershipData data) + { + CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString(), data.PrincipalID); + m_RoleMembership[dkey] = data; + return true; + } + + public bool DeleteRoleMember(RoleMembershipData data) + { + CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString(), data.PrincipalID); + if (m_RoleMembership.ContainsKey(dkey)) + return m_RoleMembership.Remove(dkey); + + return false; + } + + public bool DeleteMemberAllRoles(UUID groupID, string principalID) + { + List keys = m_RoleMembership.Keys.Where(k => k.Key.StartsWith(groupID.ToString()) && k.Key.EndsWith(principalID)).ToList(); + foreach (CompositeKey k in keys) + m_RoleMembership.Remove(k); + return true; + } + #endregion + + #region principals table + public bool StorePrincipal(PrincipalData data) + { + m_Principals[data.PrincipalID] = data; + return true; + } + + public PrincipalData RetrievePrincipal(string principalID) + { + if (m_Principals.ContainsKey(principalID)) + return m_Principals[principalID]; + + return null; + } + + public bool DeletePrincipal(string principalID) + { + if (m_Principals.ContainsKey(principalID)) + return m_Principals.Remove(principalID); + return false; + } + #endregion + + #region invites table + public bool StoreInvitation(InvitationData data) + { + return false; + } + + public InvitationData RetrieveInvitation(UUID inviteID) + { + return null; + } + + public InvitationData RetrieveInvitation(UUID groupID, string principalID) + { + return null; + } + + public bool DeleteInvite(UUID inviteID) + { + return false; + } + + public void DeleteOldInvites() + { + } + #endregion + + #region notices table + public bool StoreNotice(NoticeData data) + { + return false; + } + + public NoticeData RetrieveNotice(UUID noticeID) + { + return null; + } + + public NoticeData[] RetrieveNotices(UUID groupID) + { + return new NoticeData[0]; + } + + public bool DeleteNotice(UUID noticeID) + { + return false; + } + + public void DeleteOldNotices() + { + } + #endregion + + } +} -- cgit v1.1 From 25ca8695f3746b000fee42a0d73b91dfa6a1c9c0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 13 May 2017 20:21:56 +0100 Subject: find parcels by GlobalID.. well most time --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 3d44a33..48dc840 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -96,6 +96,11 @@ namespace OpenSim.Tests.Common return GetNoLand(); } + public ILandObject GetLandObject(UUID ID) + { + return GetNoLand(); + } + public ILandObject GetLandObject(float x, float y) { return GetNoLand(); -- cgit v1.1 From c68e7b66218a6f85fdca71be2740bf9a15e92f37 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 31 May 2017 23:31:02 +0100 Subject: change child agents close control; disablesimulator is not a caps event message --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 3e00d82..f2ce064 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -108,12 +108,12 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "Enqueue", o); return true; } - +/* public void DisableSimulator(ulong handle, UUID avatarID) { AddEvent(avatarID, "DisableSimulator", handle); } - +*/ public void EnableSimulator (ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) { AddEvent(avatarID, "EnableSimulator", handle); -- cgit v1.1 From 1a8a77c41e4061b75ff97fcf89e39717550bfa25 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 24 Jun 2017 09:24:56 +0100 Subject: revert the thread level change; remove unused dynamic texture timer from internal code; let blend alpha work if < 255; let blend work with the selected face; etc --- OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs index 5e6a638..e9767f3 100644 --- a/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs +++ b/OpenSim/Tests/Stress/VectorRenderModuleStressTests.cs @@ -118,8 +118,7 @@ namespace OpenSim.Tests.Stress so.UUID, m_tests.Vrm.GetContentType(), string.Format("PenColour BLACK; MoveTo 40,220; FontSize 32; Text {0};", text), - "", - 0); + ""); Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); -- cgit v1.1 From aff9c345dddfa290222ceaf42b6c452a590a2276 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 12 Jul 2017 07:27:21 +0100 Subject: osSetParcelDetails: add more land update code --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 48dc840..05db03fe 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -109,6 +109,7 @@ namespace OpenSim.Tests.Common public bool IsLandPrimCountTainted() { return false; } public bool IsForcefulBansAllowed() { return false; } public void UpdateLandObject(int localID, LandData data) {} + public void SendParcelsOverlay(IClientAPI client) {} public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) {} public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) {} public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) {} -- cgit v1.1 From 3052c7080a5978b78774be1b846d7a881fe3e5f0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 14:48:38 -0700 Subject: Added comment just to trigger jenkins --- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 7d8027f..d5a36cc 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -74,6 +74,7 @@ namespace OpenSim.Tests.Permissions // Try A2 takes copies of objects that cannot be copied. for (int i = 0; i < 6; i++) TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); + // Ad-hoc. Enough time to let the take work. Thread.Sleep(5000); List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); -- cgit v1.1 From af5573728a1c139607fe189d5a532db1e16d0f8b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 15:01:19 -0700 Subject: Another comment for testing jenkins --- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index d5a36cc..b2c6e76 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -87,6 +87,7 @@ namespace OpenSim.Tests.Permissions // Try A2 takes copies of objects that can be copied. for (int i = 0; i < 6; i++) TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]); + // Ad-hoc. Enough time to let the take work. Thread.Sleep(5000); items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID); -- cgit v1.1 From 26a4c5ff85562cde2fd84286d3d486f868c8ce55 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:15:08 -0700 Subject: Comment to trigger jenkins --- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index b2c6e76..66a228a 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -103,6 +103,7 @@ namespace OpenSim.Tests.Permissions private void TakeOneBox(List objs, string name, PermissionMask mask) { + // Find the object inworld SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID); Assert.That(box, Is.Not.Null, name); -- cgit v1.1 From 40f4b30361d10db4ac35bcec5e172e8f6ae012c4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:33:21 -0700 Subject: Strengthen the tests for the possibility that SetUpFixture does not run in the beginning. --- OpenSim/Tests/Permissions/DirectTransferTests.cs | 7 +++++++ OpenSim/Tests/Permissions/IndirectTransferTests.cs | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index c68bbdf..c3dfa6c 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -44,6 +44,13 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common c = new Common(); + c.SetUp(); + } + Common.TheInstance.DeleteObjectsFolders(); } diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 66a228a..e33332a 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -46,6 +46,12 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common c = new Common(); + c.SetUp(); + } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From 6a0b7a607f13fcee447c9d10224d5ea77db4f355 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:40:36 -0700 Subject: This is the correct work around. Jenkins is confuzzled. --- OpenSim/Tests/Permissions/DirectTransferTests.cs | 4 ++-- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index c3dfa6c..0f251db 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -47,8 +47,8 @@ namespace OpenSim.Tests.Permissions // In case we're dealing with some older version of nunit if (Common.TheInstance == null) { - Common c = new Common(); - c.SetUp(); + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); } Common.TheInstance.DeleteObjectsFolders(); diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index e33332a..fb96b8b 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -49,8 +49,8 @@ namespace OpenSim.Tests.Permissions // In case we're dealing with some older version of nunit if (Common.TheInstance == null) { - Common c = new Common(); - c.SetUp(); + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From 8b6557e377f7bac1bdb38f3e6dd22c797417d09c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:49:11 -0700 Subject: Let's try giving Common a default constructor instead of the workaround --- OpenSim/Tests/Permissions/Common.cs | 4 ++++ OpenSim/Tests/Permissions/DirectTransferTests.cs | 7 ------- OpenSim/Tests/Permissions/IndirectTransferTests.cs | 6 ------ 3 files changed, 4 insertions(+), 13 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index 4ecce38..cf4d2bd 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -60,6 +60,10 @@ namespace OpenSim.Tests.Permissions private TestScene m_Scene; private ScenePresence[] m_Avatars = new ScenePresence[3]; + public Common() + { + } + [SetUp] public override void SetUp() { diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index 0f251db..c68bbdf 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -44,13 +44,6 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { - // In case we're dealing with some older version of nunit - if (Common.TheInstance == null) - { - Common.TheInstance = new Common(); - Common.TheInstance.SetUp(); - } - Common.TheInstance.DeleteObjectsFolders(); } diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index fb96b8b..66a228a 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -46,12 +46,6 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { - // In case we're dealing with some older version of nunit - if (Common.TheInstance == null) - { - Common.TheInstance = new Common(); - Common.TheInstance.SetUp(); - } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From eb837defdf7d9f260603fe400b3a482258605f43 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 14 Aug 2017 16:55:50 -0700 Subject: Revert "Let's try giving Common a default constructor instead of the workaround" This reverts commit 8b6557e377f7bac1bdb38f3e6dd22c797417d09c. --- OpenSim/Tests/Permissions/Common.cs | 4 ---- OpenSim/Tests/Permissions/DirectTransferTests.cs | 7 +++++++ OpenSim/Tests/Permissions/IndirectTransferTests.cs | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs index cf4d2bd..4ecce38 100644 --- a/OpenSim/Tests/Permissions/Common.cs +++ b/OpenSim/Tests/Permissions/Common.cs @@ -60,10 +60,6 @@ namespace OpenSim.Tests.Permissions private TestScene m_Scene; private ScenePresence[] m_Avatars = new ScenePresence[3]; - public Common() - { - } - [SetUp] public override void SetUp() { diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index c68bbdf..0f251db 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs @@ -44,6 +44,13 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); + } + Common.TheInstance.DeleteObjectsFolders(); } diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs index 66a228a..fb96b8b 100644 --- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs @@ -46,6 +46,12 @@ namespace OpenSim.Tests.Permissions [SetUp] public void SetUp() { + // In case we're dealing with some older version of nunit + if (Common.TheInstance == null) + { + Common.TheInstance = new Common(); + Common.TheInstance.SetUp(); + } Common.TheInstance.DeleteObjectsFolders(); } -- cgit v1.1 From 2f13b68d4f4fd634eaee005bdf4c4a8e21c21c9a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 16 Nov 2017 17:50:06 +0000 Subject: add missing part of mutes list protocol --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a835925..449716b 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1315,6 +1315,10 @@ namespace OpenSim.Tests.Common { } + public void SendEmpytMuteList() + { + } + public void SendMuteListUpdate(string filename) { } -- cgit v1.1 From aee981e5e2c0bbbfc5c6e840fe13fb107bc47804 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 14 Jul 2018 21:48:59 +0100 Subject: http reusecontext is obsolete --- OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs index 2e17f1e..4577ca3 100644 --- a/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs +++ b/OpenSim/Tests/Common/Mock/TestOSHttpResponse.cs @@ -117,8 +117,6 @@ namespace OpenSim.Tests.Common /// public string StatusDescription { get; set; } - public bool ReuseContext { get; set; } - /// /// Add a header field and content to the response. /// -- cgit v1.1 From e15fca60d1efcfe32e795e3494e35bdae26111e2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 21 Jul 2018 18:31:58 +0100 Subject: mantis8342: make max ban height above ground configurable per regions instance with ini file option BanLineSafeHeight --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 05db03fe..cb16f55 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -42,6 +42,8 @@ namespace OpenSim.Tests.Common private Scene m_scene; private List m_parcels; + public float BanLineSafeHeight { get { return 100f; } } + public TestLandChannel(Scene scene) { m_scene = scene; -- cgit v1.1 From cded99626595dba9f15ad5485cf2fe1260c3266f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 25 Nov 2018 18:56:38 +0000 Subject: remove a dev only conditional on lludp handlers; change parcel lists updates a bit; --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 449716b..91a71ec 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -343,6 +343,8 @@ namespace OpenSim.Tests.Common public event GodlikeMessage onGodlikeMessage; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; public event GenericCall2 OnUpdateThrottles; + public event AgentFOV OnAgentFOV; + #pragma warning restore 67 /// -- cgit v1.1 From 4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Dec 2018 13:52:59 +0000 Subject: now break several things at same time... sog/sop updates, threads options,... --- OpenSim/Tests/Common/Mock/TestClient.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 91a71ec..6e8cc9f 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -441,6 +441,7 @@ namespace OpenSim.Tests.Common public virtual int NextAnimationSequenceNumber { get { return 1; } + set { } } public IScene Scene -- cgit v1.1 From 813fda90dabacc11d78bfbeb50b9e5cef79b1877 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 31 Dec 2018 16:58:44 +0000 Subject: temporary HACK to not kill some viewers --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6e8cc9f..151dcca 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -354,6 +354,8 @@ namespace OpenSim.Tests.Common public ISceneAgent SceneAgent { get; set; } + public bool DoObjectAnimations { get; set; } + /// /// The last caps seed url that this client was given. /// -- cgit v1.1 From 02492f7b15f29419c1ea4725a6ae6959bc199912 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 1 Jan 2019 12:06:29 +0000 Subject: replace my hack by others hack --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 151dcca..b0ede78 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -354,7 +354,7 @@ namespace OpenSim.Tests.Common public ISceneAgent SceneAgent { get; set; } - public bool DoObjectAnimations { get; set; } + public bool SupportObjectAnimations { get; set; } /// /// The last caps seed url that this client was given. -- cgit v1.1 From b24c669c16d574a30a856839dd5fcbf8c1d4eabe Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 2 Jan 2019 16:44:13 +0000 Subject: more on the hack (runprebuild) --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index b0ede78..ecf3785 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1404,5 +1404,8 @@ namespace OpenSim.Tests.Common public void SendPartPhysicsProprieties(ISceneEntity entity) { } + + public void CheckViewerCaps() { } + } } -- cgit v1.1 From 0c38d52538a5d713e034fcec8da8df434e3ca924 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 20 Jan 2019 20:58:27 +0000 Subject: cosmetics on terrain patchs --- OpenSim/Tests/Common/Mock/TestClient.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ecf3785..de9ab98 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -653,14 +653,11 @@ namespace OpenSim.Tests.Common return false; } - public virtual void SendLayerData(float[] map) + public virtual void SendLayerData() { } - public virtual void SendLayerData(int px, int py, float[] map) - { - } - public virtual void SendLayerData(int px, int py, float[] map, bool track) + public void SendLayerData(int[] map) { } -- cgit v1.1 From fad63ca814650b1ffb084bac859fb8df651c7374 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 21 Jan 2019 06:09:08 +0000 Subject: missing file --- OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index a73a0b8..8379b0a 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -337,7 +337,7 @@ namespace OpenSim.Data.Null public void StoreTerrain(double[,] ter, UUID regionID) { - m_terrains[regionID] = new HeightmapTerrainData(ter); + m_terrains[regionID] = new TerrainData(ter); } public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) -- cgit v1.1 From 367bd48d9133ae2d60dd63c3c9fa7acb747a7d20 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 25 Jan 2019 21:21:23 +0000 Subject: script mono is meaningless for us --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index f2ce064..9880c91 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -167,7 +167,7 @@ namespace OpenSim.Tests.Common AddEvent(receiverAgent, "AgentGroupDataUpdate", data); } - public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono) + public void ScriptRunningEvent (UUID objectID, UUID itemID, bool running, UUID avatarID) { Console.WriteLine("ONE"); throw new System.NotImplementedException (); -- cgit v1.1 From 695d807696709920eb12c2d4bd8af07af922566d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 26 Jan 2019 16:42:42 +0000 Subject: change encoding of a few event caps messages --- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 9880c91..b17425a 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -30,6 +30,7 @@ using System.Collections; using System.Collections.Generic; using System.Net; using System.Reflection; +using System.Text; using System.Threading; using log4net; using Nini.Config; @@ -183,5 +184,15 @@ namespace OpenSim.Tests.Common { AddEvent(avatarID, "partPhysicsProperties", localID, physhapetype, density, friction, bounce, gravmod); } - } + + public StringBuilder StartEvent(string eventName) + { + return null; + } + + public string EndEvent(StringBuilder sb) + { + return ""; + } +} } \ No newline at end of file -- cgit v1.1 From 9ccca71c1b13ed4e12c739774ca703cfafed5480 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 17 Mar 2019 19:00:02 +0000 Subject: remove redundant code --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index de9ab98..022ebdf 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -576,10 +576,6 @@ namespace OpenSim.Tests.Common { } - public virtual void SendStartPingCheck(byte seq) - { - } - public virtual void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List Data) { } -- cgit v1.1 From 182977a872f837a29f936964d8df55942187261a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 19 Mar 2019 06:38:43 +0000 Subject: do not send parceloverlay on crossings (may be bad, or not) --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index cb16f55..87cbede 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -119,6 +119,6 @@ namespace OpenSim.Tests.Common public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} - public void sendClientInitialLandInfo(IClientAPI remoteClient) { } + public void sendClientInitialLandInfo(IClientAPI remoteClient, bool overlay = true) { } } } \ No newline at end of file -- cgit v1.1 From b10a3ba0232031a1daac2a972478b7c34b7ec7ff Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 19 Mar 2019 06:52:57 +0000 Subject: take the deafult on the parameter overlay --- OpenSim/Tests/Common/Mock/TestLandChannel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs index 87cbede..b5227aa 100644 --- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs +++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs @@ -119,6 +119,6 @@ namespace OpenSim.Tests.Common public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {} - public void sendClientInitialLandInfo(IClientAPI remoteClient, bool overlay = true) { } + public void sendClientInitialLandInfo(IClientAPI remoteClient, bool overlay) { } } } \ No newline at end of file -- cgit v1.1 From d6b3413c6337f8409b78266ac987aac63a5f77e5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 20 Mar 2019 15:09:53 +0000 Subject: RegionHandshake IS critical llupd protocol not to be done by odd modules --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 022ebdf..bc6cb60 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -876,7 +876,7 @@ namespace OpenSim.Tests.Common { } - public virtual void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) + public virtual void SendRegionHandshake() { if (OnRegionHandShakeReply != null) { -- cgit v1.1 From d0052c817486a1691fc4e2e7027ac41240b966aa Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 23 Mar 2019 02:18:32 +0000 Subject: add more test code to make usage od compressed updates etc. Should be disable, but well many things can go wrong. --- OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index bc6cb60..4fe2684 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -119,7 +119,7 @@ namespace OpenSim.Tests.Common public event DeRezObject OnDeRezObject; public event RezRestoreToWorld OnRezRestoreToWorld; - public event Action OnRegionHandShakeReply; + public event Action OnRegionHandShakeReply; public event GenericCall1 OnRequestWearables; public event Action OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; @@ -880,7 +880,7 @@ namespace OpenSim.Tests.Common { if (OnRegionHandShakeReply != null) { - OnRegionHandShakeReply(this); + OnRegionHandShakeReply(this, 0); } } -- cgit v1.1 From 6cf85a3db111c2f8e56dde8a05ff3cf13f5ecd14 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 30 Mar 2019 12:07:49 +0000 Subject: a few more changes on initial objects send --- OpenSim/Tests/Common/Mock/TestClient.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 4fe2684..0af49f2 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -119,7 +119,7 @@ namespace OpenSim.Tests.Common public event DeRezObject OnDeRezObject; public event RezRestoreToWorld OnRezRestoreToWorld; - public event Action OnRegionHandShakeReply; + public event Action OnRegionHandShakeReply; public event GenericCall1 OnRequestWearables; public event Action OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; @@ -880,7 +880,7 @@ namespace OpenSim.Tests.Common { if (OnRegionHandShakeReply != null) { - OnRegionHandShakeReply(this, 0); + OnRegionHandShakeReply(this); } } @@ -1398,7 +1398,10 @@ namespace OpenSim.Tests.Common { } - public void CheckViewerCaps() { } + public uint GetViewerCaps() + { + return 0; + } } } -- cgit v1.1 From 98be9969912921b67e1fd831fb567d18ad84823b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 30 Mar 2019 12:56:23 +0000 Subject: missing file --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0af49f2..0031127 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1400,7 +1400,7 @@ namespace OpenSim.Tests.Common public uint GetViewerCaps() { - return 0; + return 0x1000; } } -- cgit v1.1 From 15b6d8c1477e6a294819bf5c0c510d909997fb8f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 4 Apr 2019 00:50:54 +0100 Subject: send agent view range to new child agents --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0031127..3cd5253 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -369,6 +369,8 @@ namespace OpenSim.Tests.Common set { } } + public float StartFar { get; set; } + public virtual UUID AgentId { get { return m_agentId; } -- cgit v1.1 From 9ff7601214c8cbc022308dc62ed8aa321598a1df Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 9 Jun 2019 20:15:36 +0100 Subject: reduce some useless array copies --- OpenSim/Tests/Common/Mock/TestClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 3cd5253..fd14291 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -819,7 +819,8 @@ namespace OpenSim.Tests.Common { } - public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) + public virtual void SendXferPacket(ulong xferID, uint packet, + byte[] XferData, int XferDataOffset, int XferDatapktLen, bool isTaskInventory) { } -- cgit v1.1 From cd641e8629dc0f53c1ee2034b7c43b11a988781a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 31 Jul 2019 00:37:27 +0100 Subject: fix configuration loader test --- OpenSim/Tests/ConfigurationLoaderTest.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/ConfigurationLoaderTest.cs b/OpenSim/Tests/ConfigurationLoaderTest.cs index a409a13..2a67b84 100644 --- a/OpenSim/Tests/ConfigurationLoaderTest.cs +++ b/OpenSim/Tests/ConfigurationLoaderTest.cs @@ -114,6 +114,7 @@ namespace OpenSim.Tests IConfigSource argvSource = new IniConfigSource(); EnvConfigSource envConfigSource = new EnvConfigSource(); argvSource.AddConfig("Startup").Set("inifile", mainIniFile); + argvSource.AddConfig("Network"); ConfigSettings configSettings; NetworkServersInfo networkInfo; -- cgit v1.1 From c3e74d9e044618b012f38d3d00aeac2dd212bf45 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 7 Aug 2019 18:19:56 +0100 Subject: Put a scope un users. Should fix Unknown UserUMMAU43 unless the user IS unknown --- OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 OpenSim/Tests/Common/Mock/TestClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs old mode 100644 new mode 100755 index fd14291..6cea71f --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -453,6 +453,11 @@ namespace OpenSim.Tests.Common get { return m_scene; } } + public UUID ScopeId + { + get { return UUID.Zero; } + } + public bool SendLogoutPacketWhenClosing { set { } -- cgit v1.1 From 9d6c996570377f137f93d16c388746f949b9a841 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 11 Sep 2019 13:51:43 +0100 Subject: extent supported number of avatar textures/bakes/wearables, tell viewers about it on lludp RegionHandShake; propagate agenthover; block teleports/crossings based on worn wearables and peer version; --- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6cea71f..929fa4a 100755 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -570,7 +570,7 @@ namespace OpenSim.Tests.Common { } - public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) + public virtual void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry, float hover) { } -- cgit v1.1 From be34b8e79de25d5d30f2c22d2657cbe965693540 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 6 Oct 2019 23:57:47 +0100 Subject: Fix build break --- OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs index 8f312eb..4eba7b9 100644 --- a/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs +++ b/OpenSim/Tests/Robust/Clients/InstantMessage/IMClient.cs @@ -50,7 +50,7 @@ namespace Robust.Tests im.message = "Hello"; im.imSessionID = new Guid(); - bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im); + bool success = InstantMessageServiceConnector.SendInstantMessage(DemonServer.Address, im, String.Empty); Assert.IsFalse(success, "Sending of IM succeeded, but it should have failed"); } -- cgit v1.1 From 01832b3e3c484b47f44a7514d0d8758f38fe344a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 11 Nov 2019 12:54:42 +0000 Subject: missing file, of course --- OpenSim/Tests/Common/Mock/MockScriptEngine.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs index 9d426f6..237d7a5 100644 --- a/OpenSim/Tests/Common/Mock/MockScriptEngine.cs +++ b/OpenSim/Tests/Common/Mock/MockScriptEngine.cs @@ -109,6 +109,11 @@ namespace OpenSim.Tests.Common throw new System.NotImplementedException (); } + public void CancelScriptEvent(UUID itemID, string eventName) + { + + } + public bool PostScriptEvent(UUID itemID, string name, object[] args) { // Console.WriteLine("Posting event {0} for {1}", name, itemID); -- cgit v1.1 From dcfd54b7608093d509cd045a152a4cde7317f66f Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 8 Sep 2020 21:17:45 +1000 Subject: Move various paths out of the bin directory. --- OpenSim/Tests/Robust/Server/DemonServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Server/DemonServer.cs b/OpenSim/Tests/Robust/Server/DemonServer.cs index 1e0797e..41c2185 100644 --- a/OpenSim/Tests/Robust/Server/DemonServer.cs +++ b/OpenSim/Tests/Robust/Server/DemonServer.cs @@ -48,8 +48,8 @@ namespace Robust.Tests [SetUp] public void StartDemon() { - if (File.Exists("Robust.Tests.log")) - File.Delete("Robust.Tests.log"); + if (File.Exists("../../logs/Robust.Tests.log")) + File.Delete("../../logs/Robust.Tests.log"); Console.WriteLine("**** Starting demon Robust server ****"); m_demon = new Thread( () => Main(new string[] {"-inifile=Robust.Tests.ini"})); -- cgit v1.1 From 237659ba30a2d6a072aae989252a1e6be0423c3c Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 9 Sep 2020 00:52:35 +1000 Subject: Remove useless executable bit that Windows adds. --- OpenSim/Tests/Common/Mock/TestClient.cs | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 OpenSim/Tests/Common/Mock/TestClient.cs (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs old mode 100755 new mode 100644 -- cgit v1.1 From 544e1c2983600ecd277577140840bea962362b2d Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 18 Aug 2021 13:21:43 +1000 Subject: Move more stuff into the var directory. --- OpenSim/Tests/Robust/Server/DemonServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Robust/Server/DemonServer.cs b/OpenSim/Tests/Robust/Server/DemonServer.cs index 41c2185..fa0c958 100644 --- a/OpenSim/Tests/Robust/Server/DemonServer.cs +++ b/OpenSim/Tests/Robust/Server/DemonServer.cs @@ -48,8 +48,8 @@ namespace Robust.Tests [SetUp] public void StartDemon() { - if (File.Exists("../../logs/Robust.Tests.log")) - File.Delete("../../logs/Robust.Tests.log"); + if (File.Exists("../../var/log/Robust.Tests.log")) + File.Delete("../../var/log/Robust.Tests.log"); Console.WriteLine("**** Starting demon Robust server ****"); m_demon = new Thread( () => Main(new string[] {"-inifile=Robust.Tests.ini"})); -- cgit v1.1