Skip to content

Commit

Permalink
chore(test): udpate testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenRuiwei committed Aug 19, 2024
1 parent e19cfba commit 2f54517
Show file tree
Hide file tree
Showing 8 changed files with 515 additions and 5 deletions.
6 changes: 1 addition & 5 deletions driver/src/blk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ pub fn probe_sdio_blk(root: &Fdt) -> Option<Arc<MMC>> {
let size = sdhci.reg().unwrap().next().unwrap().size.unwrap();
let irq_number = 33; // Hard-coded from JH7110
let sdcard = MMC::new(base_address, size, irq_number);
log::info!(
"SD Card Host
Controller found at 0x{:x}",
base_address
);
log::info!("SD Card Host Controller found at 0x{:x}", base_address);
return Some(Arc::new(sdcard));
}
log::warn!("SD Card Host Controller not found");
Expand Down
93 changes: 93 additions & 0 deletions testcase/24/final/git-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/usr/bin/busybox sh

set -x

function check_ret() {
ret=$?
if [ $ret -eq 0 ]; then
echo "=================== $1 success ==================="
else
echo "=================== $1 return $ret ==================="
exit 128
fi
}

function test_1() {
echo "==== GIT TEST 1 ==="
git --help
check_ret "git --help"
echo "==== FINISH TEST 1 ===="
}

function test_2() {
echo "==== GIT TEST 2 ==="
rm -rf test_git
mkdir test_git
cd test_git
git init
check_ret "git init"
ls .git
check_ret "ls .git"
echo -e "AAAAA11111\nBBBBB11111\n" > a.txt
git add a.txt
check_ret "git add a.txt"
git commit -m "init commit"
check_ret "git commit -m \"init commit\""
echo -e "AAAAA11111\nBBBBB11111\nCCCCC22222" > a.txt
git diff a.txt
git add a.txt
check_ret "git add a.txt"
git commit -m "update a.txt"
check_ret "git commit -m \"update a.txt\""
git reflog
check_ret "git reflog"
cd ..
echo "==== FINISH TEST 2 ===="
}

# GIT_REPO=192.168.10.210/student
function test_3() {
echo "=== START TEST 3 ==="
rm -rf os-2024-http
git clone http://$GIT_REPO/os-2024-http
check_ret "git clone http://$GIT_REPO/os-2024-http"
cat os-2024-http/README.md

rm -rf os-2024-http
mkdir os-2024-http
cd os-2024-http
git init
git remote add origin http://$GIT_REPO/os-2024-http
check_ret "git remote add origin http://$GIT_REPO/os-2024-http"
git pull origin main
check_ret "git pull origin main"
cat README.md
cd ..
echo "=== FINISH TEST 3 ===="
}

# GIT_REPO_SSH=192.168.10.210:2222/student
function test_4() {
echo "=== START TEST 4 ===="
rm -rf os-2024-ssh
#git clone ssh://user@$GIT_REPO/os-2024-ssh
git clone --config core.sshCommand="ssh -i git-key/students.key" ssh://git@$GIT_REPO_SSH/os-2024-ssh

check_ret "git clone ssh://git@$GIT_REPO_SSH/os-2024-ssh"
cat os-2024-http/README.md

#rm -rf os-2024-ssh
#mkdir os-2024-ssh
#cd os-2024-ssh
#git init
#git remote add origin ssh://git@$GIT_REPO_SSH/os-2024-ssh
#check_ret "git remote add origin ssh://git@$GIT_REPO_SSH/os-2024-ssh"
#git pull origin main
#check_ret
}

test_1
test_2
test_3
test_4

Loading

0 comments on commit 2f54517

Please sign in to comment.