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 Apr 1, 2022
1 parent e572d16 commit f0f3cd4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
16 changes: 14 additions & 2 deletions src/net/freertr/cfg/cfgInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ private static String doTrimmer(String s) {
* @param cmds commands
* @param defs defaults
* @param inhs inheritables
* @param cfgs configs
*/
public static void executeHWcommands(List<String> cmds, List<String> defs, List<String> inhs) {
public static void executeHWcommands(List<String> cmds, List<String> defs, List<String> inhs, List<String> cfgs) {
if (cmds == null) {
return;
}
Expand Down Expand Up @@ -436,6 +437,11 @@ public static void executeHWcommands(List<String> cmds, List<String> defs, List<
cfgAll.defaultF.add(new userFilter("", s, null));
continue;
}
if (s.equals("cfg")) {
s = cmd.getRemaining();
cfgs.add(s);
continue;
}
if (s.equals("port")) {
vdcPortBeg = bits.str2num(cmd.word());
vdcPortEnd = bits.str2num(cmd.word());
Expand Down Expand Up @@ -899,11 +905,12 @@ private static void doInit(List<String> hw, List<String> sw, pipeSide cons) {
inis.addAll(userFilter.getSecList(secs, needInit[i], cmds.tabulator + cmds.finish));
}
List<String> ints = userFilter.section2text(userFilter.filter2text(secs, createFilter(needIface)), true);
List<String> hcfgs = new ArrayList<String>();
List<String> hdefs = new ArrayList<String>();
List<String> inhs = new ArrayList<String>();
logger.info("initializing hardware");
try {
executeHWcommands(hw, hdefs, inhs);
executeHWcommands(hw, hdefs, inhs, hcfgs);
} catch (Exception e) {
logger.exception(e);
}
Expand Down Expand Up @@ -938,6 +945,11 @@ private static void doInit(List<String> hw, List<String> sw, pipeSide cons) {
if (res > 0) {
logger.error(res + " errors found");
}
try {
executeSWcommands(hcfgs, true);
} catch (Exception e) {
logger.traceback(e);
}
int step = cfgAll.vdcs.size();
if (step > 0) {
step = (vdcPortEnd - vdcPortBeg) / step;
Expand Down
2 changes: 1 addition & 1 deletion src/net/freertr/user/userTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ public cfgAlias doer() {
return null;
}
if (a.equals("hwcfg")) {
cfgInit.executeHWcommands(bits.str2lst(cmd.getRemaining()), new ArrayList<String>(), new ArrayList<String>());
cfgInit.executeHWcommands(bits.str2lst(cmd.getRemaining()), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>());
return null;
}
if (a.equals("hwext")) {
Expand Down
3 changes: 2 additions & 1 deletion src/rtr-hw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ int eth8 eth 0000.1111.3333 127.0.0.1 22702 127.0.0.1 22701
int eth9 eth 0000.1111.4444 127.0.0.1 22701 127.0.0.1 22702
!line tty1 127.0.0.1 21001 127.0.0.1 21002
tcp2vrf 8080 v1 80
def alias test bash command attach shell1 socat - exec:bash,ctty,pty,stderr
def alias test bash command attach shell1 /rtr/ptyRun.bin /bin/bash
cfg alias test bash command attach shell1 /rtr/ptyRun.bin /bin/bash
1 change: 0 additions & 1 deletion src/rtr-sw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ dial-peer 1
direction both
exit
!
alias test bash command attach shell1 /rtr/ptyRun.bin /bin/bash
!
server telnet tel
security authentication access
Expand Down

0 comments on commit f0f3cd4

Please sign in to comment.