From cb65769afc9ecf2f054779c6479a7dc7fa0a8258 Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Tue, 10 Jan 2023 20:32:46 +0800 Subject: [PATCH] =?UTF-8?q?shell=E5=91=BD=E4=BB=A4=E7=AE=A1=E6=8E=A7?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- .../BUILD.gn | 1 + .../AppScope/app.json | 21 +++++ .../resources/base/element/string.json | 8 ++ .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../actsshellcommandcontroltest/BUILD.gn | 43 ++++++++++ .../actsshellcommandcontroltest/Test.json | 21 +++++ .../main/ets/Application/MyAbilityStage.ts | 23 ++++++ .../src/main/ets/MainAbility/MainAbility.ts | 61 ++++++++++++++ .../ets/TestRunner/OpenHarmonyTestRunner.ts | 75 ++++++++++++++++++ .../entry/src/main/ets/pages/index/index.ets | 40 ++++++++++ .../entry/src/main/ets/test/List.test.ets | 20 +++++ .../ets/test/ShellCommandControl.test.ets | 61 ++++++++++++++ .../entry/src/main/module.json | 27 +++++++ .../main/resources/base/element/string.json | 24 ++++++ .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/main_pages.json | 5 ++ .../signature/openharmony_sx.p7b | Bin 0 -> 3647 bytes 17 files changed, 430 insertions(+) create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/app.json create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/resources/base/media/app_icon.png create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/BUILD.gn create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/Test.json create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/Application/MyAbilityStage.ts create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/MainAbility/MainAbility.ts create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/pages/index/index.ets create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/List.test.ets create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/ShellCommandControl.test.ets create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/module.json create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/element/string.json create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/media/icon.png create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/profile/main_pages.json create mode 100644 ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/signature/openharmony_sx.p7b diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/BUILD.gn b/ability/ability_runtime/actsshellcommandfunctionalitytest/BUILD.gn index 8dbba44f8..c90c665f6 100755 --- a/ability/ability_runtime/actsshellcommandfunctionalitytest/BUILD.gn +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/BUILD.gn @@ -19,6 +19,7 @@ group("actsshellcommandfunctionalitytest") { deps = [ "ActsExecuteShellCommandTest:ActsExecuteShellCommandTest", "ActsKillProcessWithAccountCloseRelyHap:ActsKillProcessWithAccountCloseRelyHap", + "actsshellcommandcontroltest:ActsShellCommandControlTest", ] } } diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/app.json b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/app.json new file mode 100644 index 000000000..03180e143 --- /dev/null +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/app.json @@ -0,0 +1,21 @@ +{ + "app": { + "bundleName": "com.acts.shellcommandcontroltest", + "vendor": "huawei", + "versionCode": 1000000, + "versionName": "1.0.0", + "debug": false, + "icon" : "$media:icon", + "label" : "$string:app_name", + "description" : "$string:description_application", + "distributedNotificationEnabled": true, + "keepAlive" : true, + "singleUser": true, + "minAPIVersion": 9, + "targetAPIVersion": 9, + "car": { + "apiCompatibleVersion": 9, + "singleUser": false + } + } +} diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..ec48a8748 --- /dev/null +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "AbilityStageMonitor" + } + ] +} diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69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f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + d.stdResult); + console.info('executeShellCommand : data : ' + d.exitCode); + }) + console.info('OpenHarmonyTestRunner onRun end') + } +}; \ No newline at end of file diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/pages/index/index.ets new file mode 100644 index 000000000..536912f24 --- /dev/null +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/pages/index/index.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +@Entry +@Component +struct Index { + build() { + Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('MainAbility Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/List.test.ets new file mode 100644 index 000000000..f909390bf --- /dev/null +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/List.test.ets @@ -0,0 +1,20 @@ +/* +* Copyright (c) 2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import shellCommandControlTest from './ShellCommandControl.test' + +export default function testsuite() { + shellCommandControlTest(); +} \ No newline at end of file diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/ShellCommandControl.test.ets b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/ShellCommandControl.test.ets new file mode 100644 index 000000000..01b39f837 --- /dev/null +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/ets/test/ShellCommandControl.test.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { describe, it, expect } from '@ohos/hypium' + +let TAG; +export default function shellCommandControlTest() { + describe('ShellCommandControlTest', function () { + + /** + * @tc.number: Acts_Ability_ShellCommandControl__0100 + * @tc.name: Verify that the aa command aa help can be executed + * @tc.desc: Error code 0 is returned + * @tc.level 0 + */ + it('Acts_Ability_ShellCommandControl__0100', 0, async function (done) { + TAG = 'Acts_Ability_ShellCommandControl__0100'; + console.log(`${TAG} --- start`) + let cmd = 'aa help' + globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log(`${TAG} stdResult = ${data.stdResult}`) + console.log(`${TAG} stdResult = ${JSON.stringify(err)}`) + expect(data.exitCode).assertEqual(0); + console.log(`${TAG} --- end`) + done() + }) + }) + + /** + * @tc.number: Acts_Ability_ShellCommandControl__0200 + * @tc.name: Verify that the aa command ls -l cannot be executed + * @tc.desc: Error code -1 is returned + * @tc.level 3 + */ + it('Acts_Ability_ShellCommandControl__0200', 0, async function (done) { + TAG = 'Acts_Ability_ShellCommandControl__0200'; + console.log(`${TAG} --- start`) + let cmd = 'ls -l'; + globalThis.abilityDelegator.executeShellCommand(cmd, (err, data) => { + console.log(`${TAG} stdResult = ${data.stdResult}`) + console.log(`${TAG} stdResult = ${JSON.stringify(err)}`) + expect(data.exitCode).assertEqual(-1); + console.log(`${TAG} --- end`) + done() + }) + }) + + }) +} \ No newline at end of file diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/module.json b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/module.json new file mode 100644 index 000000000..f737641a3 --- /dev/null +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/module.json @@ -0,0 +1,27 @@ +{ + "module": { + "name": "entry_test", + "type": "entry", + "srcEntrance": "./ets/Application/MyAbilityStage.ts", + "description": "$string:entry_test_desc", + "mainElement": "MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:MainAbility_desc", + "icon": "$media:icon", + "label": "$string:MainAbility_label", + "visible": true + } + ] + } +} \ No newline at end of file diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..b744e36fe --- /dev/null +++ b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,24 @@ +{ + "string": [ + { + "name": "entry_test_desc", + "value": "description" + }, + { + "name": "app_name", + "value": "ActsShellCommandControlTest" + }, + { + "name": "description_application", + "value": "demo for test" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "entry_MainAbility" + } + ] +} \ No newline at end of file diff --git a/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsshellcommandfunctionalitytest/actsshellcommandcontroltest/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;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