|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include "Te_SimPacketRel5QOSTest.h" |
|
17 |
|
18 CSimPacketRel5QOSTest::CSimPacketRel5QOSTest() |
|
19 { |
|
20 SetTestStepName(_L("Rel5QOSTest")); |
|
21 } |
|
22 |
|
23 TVerdict CSimPacketRel5QOSTest::doTestStepL() |
|
24 { |
|
25 INFO_PRINTF1(_L("BeginPacketRel5QOSTest")); |
|
26 |
|
27 CreateConfigFileL(_L("c:\\config3.txt")); |
|
28 SetTestNumberL(6); |
|
29 |
|
30 TInt ret = iPhone.Open(iTelServer,KPhoneName); |
|
31 INFO_PRINTF2(_L("Result: %d"),ret); |
|
32 TESTL(ret == KErrNone); |
|
33 INFO_PRINTF1(_L("Opened phone object")); |
|
34 TESTL(iPacketService.Open(iPhone)==KErrNone); |
|
35 INFO_PRINTF1(_L("Opened Packet object")); |
|
36 TName contextName; |
|
37 TName contextNameCompare; |
|
38 TESTL(iFirstPrimaryPacketContext.OpenNewContext(iPacketService, contextName)==KErrNone); |
|
39 contextNameCompare.Append(KSimPrimaryPacketContextName); |
|
40 contextNameCompare.AppendNum(1); |
|
41 TESTL(contextName.Compare(contextNameCompare)==KErrNone); |
|
42 INFO_PRINTF1(_L("Opened Context object")); |
|
43 |
|
44 TRequestStatus reqStatus, notifyStatus, cancelStatus; |
|
45 |
|
46 // set Release5 Qos Profile Params |
|
47 TName r5QosName; |
|
48 TESTL(iRel5Packetqos.OpenNewQoS(iFirstPrimaryPacketContext, r5QosName)==KErrNone); |
|
49 TName r5QosNameCompare; |
|
50 r5QosNameCompare.Append(KSimPacketQosName); |
|
51 r5QosNameCompare.AppendNum(1); |
|
52 TESTL(r5QosName.Compare(r5QosNameCompare)==KErrNone); |
|
53 INFO_PRINTF1(_L("Opened Rel5 QoS object")); |
|
54 |
|
55 TName qosName; |
|
56 iFirstPrimaryPacketContext.GetProfileName(qosName); |
|
57 INFO_PRINTF1(_L("Retrieved Rel5 QoS object reference name")); |
|
58 |
|
59 RPacketQoS::TQoSR5Requested aR5QoSReqConfig; |
|
60 TPckg<RPacketQoS::TQoSR5Requested> aR5QoSReqPckg(aR5QoSReqConfig); |
|
61 |
|
62 RPacketQoS::TQoSR5Negotiated aR5NotifyQoS; |
|
63 TPckg<RPacketQoS::TQoSR5Negotiated> aR5NotifyQoSPckg(aR5NotifyQoS); |
|
64 |
|
65 TInt req = 4; |
|
66 TInt min = 2; |
|
67 TInt sigOff = 0; |
|
68 TInt sigOn = 1; |
|
69 |
|
70 //Profile data |
|
71 aR5QoSReqConfig.iReqTrafficClass = RPacketQoS::ETrafficClassStreaming; // 0x04 |
|
72 aR5QoSReqConfig.iMinTrafficClass = RPacketQoS::ETrafficClassConversational; // 0x02 |
|
73 aR5QoSReqConfig.iReqDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; // 0x04 |
|
74 aR5QoSReqConfig.iMinDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired; // 0x02 |
|
75 aR5QoSReqConfig.iReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired; // 0x08 |
|
76 aR5QoSReqConfig.iMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired; // 0x04 |
|
77 aR5QoSReqConfig.iReqMaxSDUSize = req; // 4 |
|
78 aR5QoSReqConfig.iMinAcceptableMaxSDUSize = min; // 2 |
|
79 aR5QoSReqConfig.iReqMaxRate.iUplinkRate = min; // between 0 - 1840 |
|
80 aR5QoSReqConfig.iReqMaxRate.iDownlinkRate = min; |
|
81 aR5QoSReqConfig.iMinAcceptableMaxRate.iDownlinkRate = min-1; // between 0 - 1840 |
|
82 aR5QoSReqConfig.iMinAcceptableMaxRate.iUplinkRate = req; |
|
83 aR5QoSReqConfig.iReqBER = RPacketQoS::EBEROnePerHundred; // 0x04 |
|
84 aR5QoSReqConfig.iMaxBER = RPacketQoS::EBERFivePerHundred; // 0x02 |
|
85 aR5QoSReqConfig.iReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioSevenPerThousand; // 0x08 |
|
86 aR5QoSReqConfig.iMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerHundred; // 0x04 |
|
87 aR5QoSReqConfig.iReqTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; // 0x04 |
|
88 aR5QoSReqConfig.iMinTrafficHandlingPriority = RPacketQoS::ETrafficPriority1; // 0x02 |
|
89 aR5QoSReqConfig.iReqTransferDelay = req; |
|
90 aR5QoSReqConfig.iMaxTransferDelay = min; |
|
91 aR5QoSReqConfig.iReqGuaranteedRate.iDownlinkRate = min; |
|
92 aR5QoSReqConfig.iReqGuaranteedRate.iUplinkRate = req; |
|
93 aR5QoSReqConfig.iMinGuaranteedRate.iDownlinkRate = min; |
|
94 aR5QoSReqConfig.iMinGuaranteedRate.iUplinkRate = req; |
|
95 |
|
96 aR5QoSReqConfig.iSignallingIndication = sigOff; |
|
97 aR5QoSReqConfig.iSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorUnknown; |
|
98 |
|
99 //post the notification |
|
100 iRel5Packetqos.NotifyProfileChanged(notifyStatus, aR5NotifyQoSPckg); |
|
101 //Set the qos |
|
102 iRel5Packetqos.SetProfileParameters(reqStatus, aR5QoSReqPckg); |
|
103 |
|
104 User::WaitForRequest(notifyStatus); |
|
105 |
|
106 TESTL(notifyStatus.Int()==KErrNone); |
|
107 |
|
108 User::WaitForRequest(reqStatus); |
|
109 TESTL(reqStatus.Int()==KErrNone); |
|
110 INFO_PRINTF1(_L("Set Rel5 Profile Test passed")); |
|
111 |
|
112 TESTL(aR5NotifyQoS.ExtensionId()==TPacketDataConfigBase::KConfigRel5); |
|
113 TESTL(aR5NotifyQoS.iTrafficClass==RPacketQoS::ETrafficClassConversational); |
|
114 TESTL(aR5NotifyQoS.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired); |
|
115 TESTL(aR5NotifyQoS.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection); |
|
116 TESTL(aR5NotifyQoS.iMaxSDUSize==min); |
|
117 TESTL(aR5NotifyQoS.iMaxRate.iUplinkRate==min); |
|
118 TESTL(aR5NotifyQoS.iMaxRate.iDownlinkRate==req); |
|
119 TESTL(aR5NotifyQoS.iBER==RPacketQoS::EBEROnePerHundred); |
|
120 TESTL(aR5NotifyQoS.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerTen); |
|
121 TESTL(aR5NotifyQoS.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority2); |
|
122 TESTL(aR5NotifyQoS.iTransferDelay==min); |
|
123 TESTL(aR5NotifyQoS.iGuaranteedRate.iUplinkRate==min); |
|
124 TESTL(aR5NotifyQoS.iGuaranteedRate.iDownlinkRate==req); |
|
125 |
|
126 TESTL(aR5NotifyQoS.iSignallingIndication==sigOff); |
|
127 TESTL(aR5NotifyQoS.iSourceStatisticsDescriptor==RPacketQoS::ESourceStatisticsDescriptorUnknown); |
|
128 |
|
129 // post a notification |
|
130 iRel5Packetqos.NotifyProfileChanged(cancelStatus, aR5NotifyQoSPckg); |
|
131 iRel5Packetqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged); |
|
132 User::WaitForRequest(cancelStatus); |
|
133 |
|
134 TESTL(cancelStatus.Int()==KErrCancel); |
|
135 INFO_PRINTF1(_L("Set Profile Test passed")); |
|
136 |
|
137 // need to call Notify first to set pending to true after |
|
138 // cancel event which sets it to false |
|
139 iRel5Packetqos.NotifyProfileChanged(notifyStatus, aR5NotifyQoSPckg); |
|
140 User::WaitForRequest(notifyStatus); |
|
141 |
|
142 // Get QoS Rel5 Capabilities |
|
143 RPacketQoS::TQoSCapsR5 aQoSR5Caps; |
|
144 TPckg<RPacketQoS::TQoSCapsR5> aQoSR5CapsPckg(aQoSR5Caps); |
|
145 |
|
146 iRel5Packetqos.GetProfileCapabilities(reqStatus, aQoSR5CapsPckg); |
|
147 User::WaitForRequest(reqStatus); |
|
148 TESTL(reqStatus.Int()==KErrNone); |
|
149 |
|
150 TESTL(aQoSR5Caps.ExtensionId()==TPacketDataConfigBase::KConfigRel5); |
|
151 TESTL(aQoSR5Caps.iTrafficClass == RPacketQoS::ETrafficClassInteractive); |
|
152 TESTL(aQoSR5Caps.iDeliveryOrderReqd == RPacketQoS::EDeliveryOrderNotRequired); |
|
153 TESTL(aQoSR5Caps.iDeliverErroneousSDU == RPacketQoS::EErroneousSDUNoDetection); |
|
154 TESTL(aQoSR5Caps.iBER == RPacketQoS::EBEROnePerHundred); |
|
155 TESTL(aQoSR5Caps.iSDUErrorRatio == RPacketQoS::ESDUErrorRatioOnePerTen); |
|
156 TESTL(aQoSR5Caps.iTrafficHandlingPriority == RPacketQoS::ETrafficPriority2); |
|
157 |
|
158 TESTL(aQoSR5Caps.iSignallingIndication==sigOff); |
|
159 TESTL(aQoSR5Caps.iSourceStatisticsDescriptor==RPacketQoS::ESourceStatisticsDescriptorUnknown); |
|
160 INFO_PRINTF1(_L("Get QoS Profile Capabilities Test passed")); |
|
161 |
|
162 //Get QoS Profile Params |
|
163 iRel5Packetqos.GetProfileParameters(cancelStatus, aR5NotifyQoSPckg); |
|
164 iRel5Packetqos.CancelAsyncRequest(EPacketQoSGetProfileParams);//no implementation-does nothing |
|
165 User::WaitForRequest(cancelStatus); |
|
166 TESTL(cancelStatus.Int()==KErrNone); |
|
167 User::After(1000000L); |
|
168 |
|
169 // test RPacketContext::Activate - before calling ModifyActiveContext |
|
170 StartNTRasSimulation(); |
|
171 iFirstPrimaryPacketContext.Activate(reqStatus); |
|
172 User::WaitForRequest(reqStatus); |
|
173 TESTL(reqStatus.Int()==KErrNone); |
|
174 INFO_PRINTF1(_L("Activate test passed")); |
|
175 |
|
176 // test RPacketContext::ModifyActiveContext |
|
177 iFirstPrimaryPacketContext.ModifyActiveContext(reqStatus); |
|
178 User::WaitForRequest(reqStatus); |
|
179 TESTL(reqStatus.Int()==KErrNotReady); |
|
180 INFO_PRINTF1(_L("ModifyActiveContext Test Passed")); |
|
181 INFO_PRINTF1(_L("Notify Rel5 QoS Profile Test passed")); |
|
182 |
|
183 iRel5Packetqos.GetProfileParameters(reqStatus, aR5NotifyQoSPckg); |
|
184 User::WaitForRequest(reqStatus); |
|
185 |
|
186 TESTL(aR5NotifyQoS.ExtensionId()==TPacketDataConfigBase::KConfigRel5); |
|
187 TESTL(aR5NotifyQoS.iTrafficClass==RPacketQoS::ETrafficClassConversational); |
|
188 TESTL(aR5NotifyQoS.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired); |
|
189 TESTL(aR5NotifyQoS.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection); |
|
190 TESTL(aR5NotifyQoS.iMaxSDUSize==min); |
|
191 TESTL(aR5NotifyQoS.iMaxRate.iUplinkRate==min); |
|
192 TESTL(aR5NotifyQoS.iMaxRate.iDownlinkRate==req); |
|
193 TESTL(aR5NotifyQoS.iBER==RPacketQoS::EBEROnePerHundred); |
|
194 TESTL(aR5NotifyQoS.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerTen); |
|
195 TESTL(aR5NotifyQoS.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority2); |
|
196 TESTL(aR5NotifyQoS.iTransferDelay==min); |
|
197 TESTL(aR5NotifyQoS.iGuaranteedRate.iUplinkRate==min); |
|
198 TESTL(aR5NotifyQoS.iGuaranteedRate.iDownlinkRate==req); |
|
199 |
|
200 TESTL(aR5NotifyQoS.iSignallingIndication==sigOn); |
|
201 TESTL(aR5NotifyQoS.iSourceStatisticsDescriptor==RPacketQoS::ESourceStatisticsDescriptorSpeech); |
|
202 |
|
203 // End of RPacketQos tests |
|
204 iRel5Packetqos.Close(); |
|
205 iFirstPrimaryPacketContext.Close(); |
|
206 iPacketService.Close(); |
|
207 iPhone.Close(); |
|
208 ASSERT(RThread().RequestCount()==0); |
|
209 |
|
210 return TestStepResult(); |
|
211 } |
|
212 |