The Thai military estalishment, which has exercised political control of this country with brief interruptions since 1932, it facing the severest test of its fighting abilities in several decades.

Prime Minister Prem Tinsulanond is a general, as are his four deputies. Officers are found at all levels of the Thai government bureaucracy. The military is deeply involved in commercial life as well, operating a chain of gasoline stations, television and radio networks, boxing stadiums and a race track. Every important private commercial venture has a general among its directors to help with such things as licenses.

With more four-star generals than the U.S. Army, Thai armed forces have many a top officers with little to go but concentrate on whittling down his golf score.

Can they fight?

While few armies would allow a front-line commander to serve as a member of parliament at the same time, Col. Prachak Sawangchit of the Royal Thai Army's 2nd Infantry regiment was holding both jobs last month when Vietnamese troops struck briefly from Cambodia into the border zone he commanded.

Recurrent reports maintain that Prachak was in Bangkok, 130 miles from his post, to attend meetings as an appointed member of the upper house.

Whatever the truth, the colonel's dual role is nothing unusual in Thailand.

Over the years, some officers have become proficient at running ministries and others at growing wealthy through corruption or legitimate business, but few are experienced at commanding troops in the field.

When Vietnamese troops pushed into Cambodia last year, and within weeks were at its western border, the Thais faced their most tangible security threat since Japanese forces entered their country in 1941.

While publicly claiming neutrality, Thailand appears to have decided to risk giving covert support to Khmer Rouge and Khmer Serei guerrillas resisting the Vietnamese.Hanoi, in turn, has warned that bangkok will have to "bear to the consequences."

As if in preparation, Thailand last year spent about $400 million on foreign arms. Delivered or soon to arrive are 50 U.S.-made M48 tanks, wire-guided antitank missiles, recoilless rifles, F5 fighter-bomers and other weapons that could help fend off a conventional attack from Cambodia.

The proximity of Hanoi's troops forced the Thai Army to scrap decades-old patterns of deployment dictated by Bangkok politics. Its first division, normally based in and around the capital to guard whatever military clique was in power, has now moved two of its regiments to the border.

After the Vietnamese Communists overwhelmed the American-supported government in Saigon in 1975, Thailand had tried to smooth relations with Hanoi through diplomacy and an order to U.S. forces to leave the country. Today, however, with Vietnamese troops on the border, many Thai officers talk of war.

Thai and Vietnamese armies battled in Cambodia and Laos during the 19th century. Perhaps significantly, the Thais' word for their historic enemy, (Yuan ), can also mean "arrogant" or "quick to pick a fight."

Today the Thai Army faces the same enemy along the Cambodian border, Again, most of its troops come to the front with little experience in conventional war. Some military analysts feel that many Thai tanks and anti-tank weapons are obselete.

The main battle tank, the Korean War-vintage M41 has performed faultlessly in coup d'etat shows of force on the streets of Bangkok. But its 76mm artillery would be a poor match for the 100mm guns mounted on Hanoi's Soviet-supplied T54s.

Two factors are cited to explain such shortcomings. First, until Vietnam's blitz in Cambodia, few people expected a conventional challenge. Second, some analysts argue that U.S. equipment programs in the Vietnam equipment programs in the Vietnam War often were poorly planned and intended mainly as a payoff to Thai generals, who in return sent troops to Vietnam and allowed seven U.S.-operated airbases in the country.

Despite their overbearing role in politics, the Thai armed forces are not particularly large. Army strength of 160,000 is comparable on a per capita basis to the U.S. Army's. The Air Force has about 43,000 personnel, the Navy and Marines 32,000.

In tactics, equipment and organization, the military follows American models closely. Washington and Bangkok signed a defense aid agreement in 1950. The United States has delivered more than $1 billion in grant aid and U.S. advisers have trained thousands of soldiers.

Grant aid has ended, but the Thai soldier still carries U.S.-built weapons and rides in U.S.-made trucks and helicopters.

In theory, U.S. aid built a versatile Army equally skilled in fighting guerrillas or infantry backed by tanks. But after the Communist Party of Thailand opened a shooting war in border areas in 1965, counterinsurgency got priority.

Today, guerrillas continue attacks in three remote parts of the country. Army units periodically apply heavy firepower against suspected strongholds, although police and civilian development agencies head the anticommunist effort in most villages.

Now 15 years old, the insurgency is neither mushrooming nor dying out. In Bangkok, it is considered a fact of life, an annoyance. Nonetheless, it took the lives of 205 Army personnel last year.

Beginning in 1967, Thai troops learned the ropes of fighting an unseen enemy while serving in South Vietnam. A U.S.-financed division was deployed against Viet Cong in an area east of Saigon (now Ho Chi Minh City). However, it never fought a major battle.

A Thai contingent served alongside U.S. forces in the Korean War. But most of what little experience in conventional war the current generation of soldiers has come in Laos, where up to 40,000 Thais served as CIA-sponsored irregulars.

Pitted against advancing North Vietnamese forces, they took heavy casualties defending the Plain of Jars and the CIA base at Long Cheng. Military analysts gave them passing marks in set-piece defense but found them almost useless in an offensive role. Alcohol and drug abuse reportedly was rampant. Vietnamese counterattacks often triggered panic and flight.

Emergency programs are under way to correct such deficiencies. U.S. instructors have trained Thais to operate the 15 M48 heavy tanks delivered so far as well as sophisticated antitank missiles.

At the Cambodian border, troops improvise. Parallel to particularly sensitive parts of the frontier they have dug a ditch about 10 feet wide and deep to serve as a tank barrier. Elsewhere they have constructed networks of trenches and bunkers resembling mini Maginot lines.

The Army holds the bulk of its armor and manpower well back from the border. In many places its most forward positions are sleepy base camps a mile or so from the border, apparently intended more to give early warning of an attack than to repel it.

In skirmishes with the Vietnamese and righist Khmer Serei guerrillas, the Thais have employed tactics from American texts, first hitting the target with artillery or helicopter gunship fire, then cautiously moving in on foot to secure the area.

These tactics have caused hundreds of casualties among Cambodian refugees camped out along the border.

How the Thais would respond to a massive attack into their territory is, of course, a closely guarded secret. But most military specialists feel that the Army would do best to fall back beyond a river or a flooded area -- there is no natural border along much of the frontier -- and then hit at their overextended foe with superior air and artillery fire.

Would Vietnam invade Thailand outright? Most Western diplomats scoff at the idea. Hani has no territorial designs on Thailand, they say. Even if it did, too much of its million-member Army is already tied down -- 250,000 on the Chinese border, a like number in Cambodia and laos. An invasion could provoke a massive response from China and possibly the United States.

But few people rule out probes into Thailand by smaller Vietnamese forces with limited objectives -- either to destroy retreating Khmer Rouge or to warn Thailand to stop suporting the guerrillas. Many diplomats feel last month's cross-border strike was intended as such a warning.

Foreign military attaches generally feel Thai Commanders were somewhat slow in responding to that assault but once in gear made deadly use of their artillery and aircraft. Those weapons accounted for most of the 80 Vietnamese bodies the Thais have reported recovering. Thai dead were put at 22. Inexperience played a telling role.

Nine soldiers were reported killed in an ambush as they drove a pickup truck to the edge of a village the Vietnamese had seized.

Vietnamese troops used heat-seeking missiles to down a helicopter gunship and an observation plane within minutes of each other. Both were said to be dangerously low over Vietnamese positions.

There remains no consensus as to how the Thais would perform in a larger attack.

Army Commander-in-chief Prem, the current prime minister, is a new type of strongman. He is believed to be personally incorruptible. He has no major business interests. He is trim and has commanded field operations.

Still there is no denying that Prem is heading a military government -- the facade of parliamentary democracy notwithstanding.

Anthropologists have noted authoritarian strains in Thai village society, mystically based beliefs that those with power deserve it and should be obeyed. These traits are often cited to explain why a succession of often inept military strongmen has met comparatively little opposition.

Far from arousing hate, the officer in uniform commands deep respect. When lunching with a general in a restuarant, one is likely to find the kitchen has taken extra care with the food. Young couples planning a wedding often invite a senior officer to add dignity to the occasion.

Competition remains stiff for places in the preparatory school from which cadets go on to the military academies. Cadets are drawn heavily from families of career military men and provincial officials. Indeed, the military in a way exercises a democratic influence, allowing humbly born boys to achieve wealth and national position.

Once commissioned, the young officer finds himself in a hierarchy where new ideas are adopted slowly and seniority rather than performance is stressed in promotions. Since everyone rises in the ranks eventually, the officer corps is top-heavy.

Western military attaches talk of a generation gap between these men and a new generation of colonels below. Most of the younger men have trained at U.S. posts such as Fort Bragg, N.C. A few are West Point or Sandhurst graduates. Privately they are apt to complain that their superiors are too old and corrupt to meet the new challenge from Vietnam. Predictably, the Thai press has labeled them "the young Turks."

The armed forces are becoming more combat-ready as these men rise in the ranks. Like the older generation, however, they see politics as a legitimate pastime for soldiers.

Many young Turks, like Col. Prachak, the border commander, sit in the upper house and are known to make late night calls on prime ministers to deliver "advice." Bangkok newspapers consider it informative to give front-page display to the views of an anti-aircraft commander on economic development, because the man is a young Turk.

The old patterns live on, then. For 50 years, officers have been soldiers, politicians and businessmen at the same time.They show few signs of changing and many foreign analysts have concluded that their performance on the battlefield will suffer as long as they remain encumbered with the other roles.