Skip to content

Commit

Permalink
automatic commit at releng box
Browse files Browse the repository at this point in the history
  • Loading branch information
mc36 committed Dec 22, 2024
1 parent bd74077 commit 52452c5
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/org/freertr/user/userExec.java
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ public userHelping getHelping() {
hlp.add(null, "3 . <file> filename");
getHelpPipes(hlp, 120, privileged);
hl.addOther(hlp);
hl.add(null, "2 3 setperm set file permissions");
hl.add(null, "2 3 permission set file permissions");
hl.add(null, "3 4 <file> target file");
hl.add(null, "4 . <str> permissions");
hl.add(null, "2 3 receive receive file from network");
Expand Down
48 changes: 43 additions & 5 deletions src/org/freertr/user/userFlash.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public cfgAlias doer() {
rdr.putStrArr(res);
return null;
}
if (a.equals("setperm")) {
if (a.equals("permission")) {
a = cmd.word();
String s = cmd.word();
setFilePerm(a, s);
Expand Down Expand Up @@ -357,8 +357,7 @@ public cfgAlias doer() {
return null;
}
if (a.equals("count")) {
a = cmd.getRemaining();
cmd.error(a + " uses " + countUsage(a) + " bytes");
rdr.putStrTab(dirUsage(cmd.getRemaining()));
return null;
}
cmd.badCmd();
Expand Down Expand Up @@ -1104,14 +1103,53 @@ public static userFormat diskInfo(String a) {
return l;
}

/**
* direcory usage
*
* @param fn name of file to count
* @return total usage
*/
public static userFormat dirUsage(String fn) {
File[] fl = dirList(fn);
if (fl == null) {
return null;
}
userFormat res = new userFormat("|", "directory|usage");
long tot = 0;
long loc = 0;
for (int i = 0; i < fl.length; i++) {
File f = fl[i];
if (f == null) {
continue;
}
String a = f.getName();
if (!f.isDirectory()) {
try {
loc += f.length();
} catch (Exception e) {
}
continue;
}
long cur = countUsage(f.getAbsolutePath());
tot += cur;
res.add(a + "|" + cur);
}
res.add("directories|" + tot);
res.add("files|" + loc);
return res;
}

/**
* count disk usage
*
* @param fn name of file to count
* @return total usage
*/
public long countUsage(String fn) {
public static long countUsage(String fn) {
File[] fl = dirList(fn);
if (fl == null) {
return 0;
}
return recursiveUsage(fl);
}

Expand All @@ -1121,7 +1159,7 @@ public long countUsage(String fn) {
* @param fl list of files to count
* @return total usage
*/
protected long recursiveUsage(File[] fl) {
protected static long recursiveUsage(File[] fl) {
long res = 0;
for (int i = 0; i < fl.length; i++) {
File f = fl[i];
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v24.12.22-cur, done by sprscc13@mrn0b0dy.
-;-;-;2024-12-22 09:08:16, took 00:14:40, with 50 workers, on 3558 cases, 0 failed, 0 traces, 1 retries
-;-;-;2024-12-22 09:45:32, took 00:14:40, with 50 workers, on 3558 cases, 0 failed, 0 traces, 3 retries
-;-;-;./rtr.bin
http://sources.freertr.org/cfg/basic01.tst;basic01.tst;success;dummy test
http://sources.freertr.org/cfg/basic02.tst;basic02.tst;success;interface with slot
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v24.12.22-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2024-12-22 09:08:16, took 00:14:40, with 50 workers, on 3558 cases, 0 failed, 0 traces, 1 retries<br/>
tested: 2024-12-22 09:45:32, took 00:14:40, with 50 workers, on 3558 cases, 0 failed, 0 traces, 3 retries<br/>
jvm: ./rtr.bin<br/>
<br/>
<table><thead><tr><td><b>file</b></td><td><b>result</b></td><td><b>test</b></td></tr></thead><tbody>
Expand Down
2 changes: 1 addition & 1 deletion src/rtr8.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v24.12.22-cur, done by sprscc13@mrn0b0dy.
-;-;-;2024-12-22 09:18:14, took 00:09:36, with 50 workers, on 630 cases, 0 failed, 0 traces, 0 retries
-;-;-;2024-12-22 09:57:17, took 00:11:23, with 50 workers, on 630 cases, 0 failed, 0 traces, 0 retries
-;-;-;./rtr.bin
http://sources.freertr.org/cfg/p4lang-acl001.tst;p4lang-acl001.tst;success;p4lang: copp
http://sources.freertr.org/cfg/p4lang-acl002.tst;p4lang-acl002.tst;success;p4lang: ingress access list
Expand Down
2 changes: 1 addition & 1 deletion src/rtr8.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v24.12.22-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2024-12-22 09:18:14, took 00:09:36, with 50 workers, on 630 cases, 0 failed, 0 traces, 0 retries<br/>
tested: 2024-12-22 09:57:17, took 00:11:23, with 50 workers, on 630 cases, 0 failed, 0 traces, 0 retries<br/>
jvm: ./rtr.bin<br/>
<br/>
<table><thead><tr><td><b>file</b></td><td><b>result</b></td><td><b>test</b></td></tr></thead><tbody>
Expand Down

0 comments on commit 52452c5

Please sign in to comment.