|
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_SimPacketRel99QOSTest.h" |
|
17 |
|
18 CSimPacketRel99QOSTest::CSimPacketRel99QOSTest() |
|
19 { |
|
20 SetTestStepName(_L("Rel99QOSTest")); |
|
21 } |
|
22 |
|
23 TVerdict CSimPacketRel99QOSTest::doTestStepL() |
|
24 { |
|
25 INFO_PRINTF1(_L("BeginPacketRel99QOSTest")); |
|
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 Release99 Qos Profile Params |
|
47 TName r99QosName; |
|
48 TESTL(iRel99Packetqos.OpenNewQoS(iFirstPrimaryPacketContext, r99QosName)==KErrNone); |
|
49 TName r99QosNameCompare; |
|
50 r99QosNameCompare.Append(KSimPacketQosName); |
|
51 r99QosNameCompare.AppendNum(1); |
|
52 TESTL(r99QosName.Compare(r99QosNameCompare)==KErrNone); |
|
53 INFO_PRINTF1(_L("Opened Rel99 QoS object")); |
|
54 |
|
55 TName qosName; |
|
56 iFirstPrimaryPacketContext.GetProfileName(qosName); |
|
57 INFO_PRINTF1(_L("Retrieved Rel99 QoS object reference name")); |
|
58 |
|
59 RPacketQoS::TQoSR99_R4Requested aR99QoSReqConfig; |
|
60 TPckg<RPacketQoS::TQoSR99_R4Requested> aR99QoSReqPckg(aR99QoSReqConfig); |
|
61 |
|
62 RPacketQoS::TQoSR99_R4Negotiated aR99NotifyQoS; |
|
63 TPckg<RPacketQoS::TQoSR99_R4Negotiated> aR99NotifyQoSPckg(aR99NotifyQoS); |
|
64 |
|
65 TInt req = 4; |
|
66 TInt min = 2; |
|
67 |
|
68 //Profile data |
|
69 aR99QoSReqConfig.iReqTrafficClass = RPacketQoS::ETrafficClassStreaming; // 0x04 |
|
70 aR99QoSReqConfig.iMinTrafficClass = RPacketQoS::ETrafficClassConversational; // 0x02 |
|
71 aR99QoSReqConfig.iReqDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; // 0x04 |
|
72 aR99QoSReqConfig.iMinDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired; // 0x02 |
|
73 aR99QoSReqConfig.iReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired; // 0x08 |
|
74 aR99QoSReqConfig.iMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired; // 0x04 |
|
75 aR99QoSReqConfig.iReqMaxSDUSize = req; // 4 |
|
76 aR99QoSReqConfig.iMinAcceptableMaxSDUSize = min; // 2 |
|
77 aR99QoSReqConfig.iReqMaxRate.iUplinkRate = min; // between 0 - 1840 |
|
78 aR99QoSReqConfig.iReqMaxRate.iDownlinkRate = min; |
|
79 aR99QoSReqConfig.iMinAcceptableMaxRate.iDownlinkRate = min-1; // between 0 - 1840 |
|
80 aR99QoSReqConfig.iMinAcceptableMaxRate.iUplinkRate = req; |
|
81 aR99QoSReqConfig.iReqBER = RPacketQoS::EBEROnePerHundred; // 0x04 |
|
82 aR99QoSReqConfig.iMaxBER = RPacketQoS::EBERFivePerHundred; // 0x02 |
|
83 aR99QoSReqConfig.iReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioSevenPerThousand; // 0x08 |
|
84 aR99QoSReqConfig.iMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerHundred; // 0x04 |
|
85 aR99QoSReqConfig.iReqTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; // 0x04 |
|
86 aR99QoSReqConfig.iMinTrafficHandlingPriority = RPacketQoS::ETrafficPriority1; // 0x02 |
|
87 aR99QoSReqConfig.iReqTransferDelay = req; |
|
88 aR99QoSReqConfig.iMaxTransferDelay = min; |
|
89 aR99QoSReqConfig.iReqGuaranteedRate.iDownlinkRate = min; |
|
90 aR99QoSReqConfig.iReqGuaranteedRate.iUplinkRate = req; |
|
91 aR99QoSReqConfig.iMinGuaranteedRate.iDownlinkRate = min; |
|
92 aR99QoSReqConfig.iMinGuaranteedRate.iUplinkRate = req; |
|
93 |
|
94 //post the notification |
|
95 iRel99Packetqos.NotifyProfileChanged(notifyStatus, aR99NotifyQoSPckg); |
|
96 //Set the qos |
|
97 iRel99Packetqos.SetProfileParameters(reqStatus, aR99QoSReqPckg); |
|
98 |
|
99 User::WaitForRequest(notifyStatus); |
|
100 TESTL(notifyStatus.Int()==KErrNone); |
|
101 |
|
102 User::WaitForRequest(reqStatus); |
|
103 TESTL(reqStatus.Int()==KErrNone); |
|
104 INFO_PRINTF1(_L("Set Rel99 Profile Test passed")); |
|
105 |
|
106 TESTL(aR99NotifyQoS.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4); |
|
107 TESTL(aR99NotifyQoS.iTrafficClass==RPacketQoS::ETrafficClassConversational); |
|
108 TESTL(aR99NotifyQoS.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired); |
|
109 TESTL(aR99NotifyQoS.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection); |
|
110 TESTL(aR99NotifyQoS.iMaxSDUSize==min); |
|
111 TESTL(aR99NotifyQoS.iMaxRate.iUplinkRate==min); |
|
112 TESTL(aR99NotifyQoS.iMaxRate.iDownlinkRate==req); |
|
113 TESTL(aR99NotifyQoS.iBER==RPacketQoS::EBEROnePerHundred); |
|
114 TESTL(aR99NotifyQoS.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerTen); |
|
115 TESTL(aR99NotifyQoS.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority2); |
|
116 TESTL(aR99NotifyQoS.iTransferDelay==min); |
|
117 TESTL(aR99NotifyQoS.iGuaranteedRate.iUplinkRate==min); |
|
118 TESTL(aR99NotifyQoS.iGuaranteedRate.iDownlinkRate==req); |
|
119 |
|
120 // post a notification |
|
121 iRel99Packetqos.NotifyProfileChanged(cancelStatus, aR99NotifyQoSPckg); |
|
122 iRel99Packetqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged); |
|
123 User::WaitForRequest(cancelStatus); |
|
124 |
|
125 TESTL(cancelStatus.Int()==KErrCancel); |
|
126 INFO_PRINTF1(_L("Set Profile Test passed")); |
|
127 |
|
128 // need to call Notify first to set pending to true after |
|
129 // cancel event which sets it to false |
|
130 iRel99Packetqos.NotifyProfileChanged(notifyStatus, aR99NotifyQoSPckg); |
|
131 User::WaitForRequest(notifyStatus); |
|
132 |
|
133 // Get QoS Rel99 Capabilities |
|
134 RPacketQoS::TQoSCapsR99_R4 aQoSCaps; |
|
135 TPckg<RPacketQoS::TQoSCapsR99_R4> aQoSCapsPckg(aQoSCaps); |
|
136 |
|
137 iRel99Packetqos.GetProfileCapabilities(reqStatus, aQoSCapsPckg); |
|
138 User::WaitForRequest(reqStatus); |
|
139 TESTL(reqStatus.Int()==KErrNone); |
|
140 |
|
141 TESTL(aQoSCaps.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4); |
|
142 TESTL(aQoSCaps.iTrafficClass == RPacketQoS::ETrafficClassInteractive); |
|
143 TESTL(aQoSCaps.iDeliveryOrderReqd == RPacketQoS::EDeliveryOrderNotRequired); |
|
144 TESTL(aQoSCaps.iDeliverErroneousSDU == RPacketQoS::EErroneousSDUNoDetection); |
|
145 TESTL(aQoSCaps.iBER == RPacketQoS::EBEROnePerHundred); |
|
146 TESTL(aQoSCaps.iSDUErrorRatio == RPacketQoS::ESDUErrorRatioOnePerTen); |
|
147 TESTL(aQoSCaps.iTrafficHandlingPriority == RPacketQoS::ETrafficPriority2); |
|
148 INFO_PRINTF1(_L("Get QoS Profile Capabilities Test passed")); |
|
149 |
|
150 //Get QoS Profile Params |
|
151 iRel99Packetqos.GetProfileParameters(cancelStatus, aR99NotifyQoSPckg); |
|
152 iRel99Packetqos.CancelAsyncRequest(EPacketQoSGetProfileParams);//no implementation-does nothing |
|
153 User::WaitForRequest(cancelStatus); |
|
154 TESTL(cancelStatus.Int()==KErrNone); |
|
155 User::After(1000000L); |
|
156 |
|
157 // test RPacketContext::Activate - before calling ModifyActiveContext |
|
158 StartNTRasSimulation(); |
|
159 iFirstPrimaryPacketContext.Activate(reqStatus); |
|
160 User::WaitForRequest(reqStatus); |
|
161 TESTL(reqStatus.Int()==KErrNone); |
|
162 INFO_PRINTF1(_L("Activate test passed")); |
|
163 |
|
164 // test RPacketContext::ModifyActiveContext |
|
165 iFirstPrimaryPacketContext.ModifyActiveContext(reqStatus); |
|
166 User::WaitForRequest(reqStatus); |
|
167 TESTL(reqStatus.Int()==KErrNotReady); |
|
168 INFO_PRINTF1(_L("ModifyActiveContext Test Passed")); |
|
169 INFO_PRINTF1(_L("Notify Rel99 QoS Profile Test passed")); |
|
170 |
|
171 iRel99Packetqos.GetProfileParameters(reqStatus, aR99NotifyQoSPckg); |
|
172 User::WaitForRequest(reqStatus); |
|
173 |
|
174 TESTL(aR99NotifyQoS.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4); |
|
175 TESTL(aR99NotifyQoS.iTrafficClass==RPacketQoS::ETrafficClassConversational); |
|
176 TESTL(aR99NotifyQoS.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired); |
|
177 TESTL(aR99NotifyQoS.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection); |
|
178 TESTL(aR99NotifyQoS.iMaxSDUSize==min); |
|
179 TESTL(aR99NotifyQoS.iMaxRate.iUplinkRate==min); |
|
180 TESTL(aR99NotifyQoS.iMaxRate.iDownlinkRate==req); |
|
181 TESTL(aR99NotifyQoS.iBER==RPacketQoS::EBEROnePerHundred); |
|
182 TESTL(aR99NotifyQoS.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerTen); |
|
183 TESTL(aR99NotifyQoS.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority2); |
|
184 TESTL(aR99NotifyQoS.iTransferDelay==min); |
|
185 TESTL(aR99NotifyQoS.iGuaranteedRate.iUplinkRate==min); |
|
186 TESTL(aR99NotifyQoS.iGuaranteedRate.iDownlinkRate==req); |
|
187 |
|
188 INFO_PRINTF1(_L("Get Rel99 QoS Profile Test passed")); |
|
189 |
|
190 // End of RPacketQos tests |
|
191 iRel99Packetqos.Close(); |
|
192 iFirstPrimaryPacketContext.Close(); |
|
193 iPacketService.Close(); |
|
194 iPhone.Close(); |
|
195 ASSERT(RThread().RequestCount()==0); |
|
196 |
|
197 return TestStepResult(); |
|
198 } |
|
199 |