From 543fa840f847e19be16b0842716b7febbbbcb446 Mon Sep 17 00:00:00 2001 From: Timothyxxx <384084775@qq.com> Date: Fri, 16 Feb 2024 15:05:34 +0800 Subject: [PATCH] Update OS examples --- .../4d117223-a354-47fb-8b45-62ab1390a95f.json | 95 +++++++++++++++++++ .../6f56bf42-85b8-4fbb-8e06-6c44960184ba.json | 75 +++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 evaluation_examples/examples/os/4d117223-a354-47fb-8b45-62ab1390a95f.json create mode 100644 evaluation_examples/examples/os/6f56bf42-85b8-4fbb-8e06-6c44960184ba.json diff --git a/evaluation_examples/examples/os/4d117223-a354-47fb-8b45-62ab1390a95f.json b/evaluation_examples/examples/os/4d117223-a354-47fb-8b45-62ab1390a95f.json new file mode 100644 index 0000000..e1af8b6 --- /dev/null +++ b/evaluation_examples/examples/os/4d117223-a354-47fb-8b45-62ab1390a95f.json @@ -0,0 +1,95 @@ +{ + "id": "4d117223-a354-47fb-8b45-62ab1390a95f", + "snapshot": "os", + "instruction": "Change the permission of all regular files under current directory tree to 644", + "source": "NL2Bash", + "trajectory": "trajectories/", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=19bEBoYIzwIeTtqSR5Re0XTCN26yXXynn&export=download&authuser=0&confirm=t&uuid=7f9458ab-0e8a-42ff-a10a-eba01f611bc3&at=APZUnTX6GDMmAf-MOSZ58xzrFYS1:1708010153224", + "path": "setup.sh" + } + ] + } + }, + { + "type": "execute", + "parameters": { + "command": "chmod +x setup.sh", + "shell": true + } + }, + { + "type": "execute", + "parameters": { + "command": "./setup.sh", + "shell": true + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.click(960, 540); time.sleep(0.5);" + ] + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey(\"ctrl\", \"alt\", \"t\"); time.sleep(0.5); pyautogui.type(\"cd testDir\"); time.sleep(0.5); pyautogui.press(\"enter\")" + ] + } + } + ], + "related_apps": [ + "os" + ], + "evaluator": { + "postconfig": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1bLx6ZbtNgNySQrgnX9TrUNjD2zM4mOkA&export=download&authuser=0&confirm=t&uuid=5fa3b3df-e281-484f-b8d4-fcdfad210290&at=APZUnTUrg3BZ2zRykZXH-RQzyGUz:1708010154631", + "path": "eval.sh" + } + ] + } + }, + { + "type": "execute", + "parameters": { + "command": "chmod +x eval.sh", + "shell": true + } + } + ], + "func": "check_include_exclude", + "result": { + "type": "vm_command_line", + "command": "bash eval.sh", + "shell": true + }, + "expected": { + "type": "rule", + "rules": { + "include": [ + "All files have the correct permissions." + ], + "exclude": [ + ] + } + } + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/os/6f56bf42-85b8-4fbb-8e06-6c44960184ba.json b/evaluation_examples/examples/os/6f56bf42-85b8-4fbb-8e06-6c44960184ba.json new file mode 100644 index 0000000..7f010a7 --- /dev/null +++ b/evaluation_examples/examples/os/6f56bf42-85b8-4fbb-8e06-6c44960184ba.json @@ -0,0 +1,75 @@ +{ + "id": "6f56bf42-85b8-4fbb-8e06-6c44960184ba", + "snapshot": "os", + "instruction": "Copies file 'file1' to each of directories 'dir1', 'dir2', 'dir3'.", + "source": "NL2Bash", + "trajectory": "trajectories/", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1BpFAuuH0IHxpWLDF3jaFNxa9QDe_F12D&export=download&authuser=0&confirm=t&uuid=4f18ddd0-81be-414b-b701-289544cdb321&at=APZUnTXlaYyRw5kPCIK4HezQJVrO:1708051633417", + "path": "setup.sh" + } + ] + } + }, + { + "type": "execute", + "parameters": { + "command": "chmod +x setup.sh", + "shell": true + } + }, + { + "type": "execute", + "parameters": { + "command": "./setup.sh", + "shell": true + } + } + ], + "related_apps": [ + "os" + ], + "evaluator": { + "postconfig": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1fQGBoTE40BLoNV_d4KYxbYjKRJdIPDio&export=download&authuser=0&confirm=t&uuid=b380dc07-a88b-4a65-affe-f3a77108d310&at=APZUnTVe08Pyr4RSR94AmQK7S8t_:1708051631877", + "path": "eval.sh" + } + ] + } + }, + { + "type": "execute", + "parameters": { + "command": "chmod +x eval.sh", + "shell": true + } + } + ], + "func": "check_include_exclude", + "result": { + "type": "vm_command_line", + "command": "bash eval.sh", + "shell": true + }, + "expected": { + "type": "rule", + "rules": { + "include": [ + "Success: file1 exists in dir1.\nSuccess: file1 exists in dir2.\nSuccess: file1 exists in dir3.\n" + ], + "exclude": [ + ] + } + } + } +} \ No newline at end of file